ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF / OR function (https://www.excelbanter.com/excel-discussion-misc-queries/117775-if-function.html)

kraway

IF / OR function
 
I have a cell with a number 1 - 12 in it. I need function to return a value
of 1 if the value in the cell is 1 - 3, 2 if the value in the cell is 4 - 6,
3 if the value in the cell is 7 - 9, and 4 if the value in the cell is 10 -
12. I am trying to assign the quater of the year to based on the month of
the year.
I think the right function is IF combined with OR but I cannot make it work.

Please help!!

Ron Coderre

IF / OR function
 
Try this:

For
A1: (a number between 1 and 12, inclusive)
B1: =CEILING(A1/3,1)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"kraway" wrote:

I have a cell with a number 1 - 12 in it. I need function to return a value
of 1 if the value in the cell is 1 - 3, 2 if the value in the cell is 4 - 6,
3 if the value in the cell is 7 - 9, and 4 if the value in the cell is 10 -
12. I am trying to assign the quater of the year to based on the month of
the year.
I think the right function is IF combined with OR but I cannot make it work.

Please help!!


kraway

IF / OR function
 
Works great, thank you Ron!!

"Ron Coderre" wrote:

Try this:

For
A1: (a number between 1 and 12, inclusive)
B1: =CEILING(A1/3,1)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"kraway" wrote:

I have a cell with a number 1 - 12 in it. I need function to return a value
of 1 if the value in the cell is 1 - 3, 2 if the value in the cell is 4 - 6,
3 if the value in the cell is 7 - 9, and 4 if the value in the cell is 10 -
12. I am trying to assign the quater of the year to based on the month of
the year.
I think the right function is IF combined with OR but I cannot make it work.

Please help!!


PCLIVE

IF / OR function
 
Though this may not be the preferred way. The type of formula you're
requesting uses AND:

=IF(AND(A10,A1<4),1,IF(AND(A13,A1<7),2,IF(AND(A1 6,A1<10),3,IF(AND(A19,A1<13),4,"Number
does not fall within in 1-12."))))


Could also create a table and use a VLOOKUP function.
Table would be

Columns
Y Z

1 1
2 1
3 1
4 2
5 2
6 2
7 3
8 3
9 3
10 4
11 4
12 4

=VLOOKUP(A1,Y1:Z12,2)


Regards,
Paul

"kraway" wrote in message
...
I have a cell with a number 1 - 12 in it. I need function to return a
value
of 1 if the value in the cell is 1 - 3, 2 if the value in the cell is 4 -
6,
3 if the value in the cell is 7 - 9, and 4 if the value in the cell is
10 -
12. I am trying to assign the quater of the year to based on the month of
the year.
I think the right function is IF combined with OR but I cannot make it
work.

Please help!!





All times are GMT +1. The time now is 11:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com