Need help with if function for a range of data

cbc818

New Member
Joined
Feb 17, 2018
Messages
4
Hello everyone,
Long story short, I’m trying to make a little training program to teach people at my job about scheduling. I’m trying to write a formula to show somehow how many people they’ll need at each station based on projected attendance.
Let’s say O8 is where the attendance number is put in, I want P8 to read how many people are needed

Basically this:
0-200 people = 1 person per station
201- 300 = 2
301- 400 = 2-3
401-500 = 3-4
501+ = 4

I’ve tried the if function but it hasn’t worked for me. Anyone have any ideas?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
This is untested (no excel at home to try it on), but I'm still fairly confident it should work:

=If(O8<201,1,IF(AND(O8>200,O8<301),2,IF(AND(O8>300,O8<401),"2-3",IF(AND(O8>400,O8<501),"3-4",IF(O8>501,4,"ERROR")

I was basically "freehanding" that, so I may have missed a parenthesis or something, but barring that, it should work.

By the way, you should never see "ERROR", it's basically filler for that last false argument.
 
Last edited:
Upvote 0
This will get you going:

IF(O8<201,1,(IF(AND(O8>200,O8<301),2,IF(AND(O8>300,O8<401),"2-3",IF(AND(O8>400,O8<501),"3-4",IF(O8>500,4,"Not Specified"))))))
 
Upvote 0
...............or perhaps:-


Code:
=IF(AND(O8>0,O8<=200),1,IF(AND(O8>=201,O8<=300),2,IF(AND(O8>=301,O8<=400),"2-3",IF(AND(O8>=401,O8<=500),"3-4",IF(O8>501,4,"")))))

Cheerio,
vcoolio.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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
Back
Top