If Statement

FanofExcel18

Board Regular
Joined
Jun 7, 2018
Messages
65
Need Help

I'm weighting hours.

Example: Work hours for the month is 150

1 = 120<
2 = 121-135
3 = 135-150
4 = 150>
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Something like
=LOOKUP(B1,{0;121;135;150},{1;2;3;4})
 
Upvote 0
Your ranges overlap.
Assuming you mean 120 or less, 121-135, 136-150, 151 and over

=MATCH(B1,{0,120,136,151},1)

or if you're dealing with fractional hours, perhaps:
=MATCH(B1,{0,120,135.01,150.01},1)
 
Last edited:
Upvote 0
Your ranges overlap.
Assuming you mean 120 or less, 121-135, 136-150, 151 and over

=MATCH(B1,{0,120,136,151},1)

or if you're dealing with fractional hours, perhaps:
=MATCH(B1,{0,120,135.01,150.01},1)


The time could change per month. Originally I was trying to do something like:
=IF(I6 < hours!$c$10,1,if(i6=hours!$c$10,2,if(i6 > Hours!$C$10,3,4)))<hours!$c$10,1,if(i6=hours!$c$10,2,if(i6>

Hours!$C$10 = that months hours</hours!$c$10,1,if(i6=hours!$c$10,2,if(i6>
 
Last edited by a moderator:
Upvote 0
Do these bands vary from month to month
120 or less, 121-135, 136-150, 151 and over
 
Upvote 0
In that case have you tried either of the suggestions supplied?
 
Upvote 0
I do not understand what you are after.
Can you please post some data showing what you have & what you want.
There some some tools to help with that if you follow the link in my signature.
 
Upvote 0
[TABLE="width: 294"]
<colgroup><col><col span="4"></colgroup><tbody>[TR]
[TD]Time[/TD]
[TD]Amount[/TD]
[TD] [/TD]
[TD]Hours[/TD]
[TD="align: right"]142[/TD]
[/TR]
[TR]
[TD="align: right"]123[/TD]
[TD] 2[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]117[/TD]
[TD] 1[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]162[/TD]
[TD] 4[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]142[/TD]
[TD] 3[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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