Conditional IF statements

petiteshiraz

Board Regular
Joined
May 16, 2005
Messages
145
I need to create a formula that categorizes the data from column A into one of 7 categories. For example, if cell A1 is 468, I need a formula to decide which of these categories it falls into:

1. 730 or more
2. 366 to 729
3. 180 to 365
4. 90 to 179
5. 60 to 89
6. 31 to 59
7. 30 or less

How can I do this?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Marcílio_Lobão

Well-known Member
Joined
Oct 7, 2013
Messages
821
Office Version
  1. 2007
Platform
  1. Windows
petiteshiraz, Good afternoon.

Using a IF Function as you desire,

Try to use:

=IF(A1>=730, 1, IF(A1>=366, 2, IF(A1>=180, 3, IF(A1>=90, 4, IF(A1>=60, 5, IF(A1>=31, 6, 7 ))))))

Is that what you want?
I hope it helps.
 
Last edited:
Upvote 0

AliGW

Banned
Joined
Mar 9, 2014
Messages
3,628
The OP mentions IF in the thread title, but only "formula" in the post - I presume they want the most efficient way of doing it, which is why I have not offered a nested IF statement.
 
Upvote 0

Marcílio_Lobão

Well-known Member
Joined
Oct 7, 2013
Messages
821
Office Version
  1. 2007
Platform
  1. Windows
AliGW, Good afternoon.

I totally agree with you.

The use of the LOOKUP function in this case is much more efficient than the requested IF function.

The family of LOOKUP, VLOOKUP and HLOOKUP functions are spectacular.

Maybe I did not understand the user's request correctly.

Have a nice day!

Greetings from Brazil
 
Last edited:
Upvote 0

Forum statistics

Threads
1,190,786
Messages
5,982,919
Members
439,807
Latest member
WXM86

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top