#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default 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!!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default 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!!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default 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!!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default 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!!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need some comments on my Utility_Move class module. jchen Excel Worksheet Functions 0 August 21st 06 07:05 PM
Creating a Custom Excel Function to Calculate Gini Coefficients [email protected] Excel Worksheet Functions 3 February 21st 06 10:15 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 01:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"