Alternative to Nested IF for Hours of Pay

marvin jones

Board Regular
Joined
Mar 16, 2016
Messages
86
Hello There,

I have a massive IF nested formula that returns a value of 8 hours worked depending on the sum of other cells. So,

L20: IF the SUM of Q20, U20, Y20 equals 1 hour then return 7 hours | IF the SUM of Q20, U20, Y20 equals 2 hours then return 6 hours
L21: IF the SUM of Q21, U21, Y21 equals 1 hour then return 7 hours | IF the SUM of Q21, U21, Y21 equals 2 hours then return 6 hours

This is OK, but i need the hours to be split into quarters too. So,

L20: IF the SUM of Q20, U20, Y20 equals 1.25 hours then return 6.75 hours | IF the SUM of Q20, U20, Y20 equals 2.25 hours then return 5.75 hours
L21: IF the SUM of Q21, U21, Y21 equals 1.50 hour then return 6.50 hours | IF the SUM of Q21, U21, Y21 equals 0.50 hours then return 7.50 hours

This calculation works out a time for each employee each day, so a nested IF statement summing this up will just be too much.

Is there an easier way please?

Thank you,
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
You could create a lookup table this and use your sum value to lookup result using VLOOKUP or XLOOKUP (365).



1625701755736.png


Kind regards

Saba
 
Upvote 0
if you do not want to use separate table, you can use array approach as showing below.

=VLOOKUP(sum(Q20, U20, Y20),{1,7;1.25,6.75;2.25,5.75;1.5,6.5;0.5,7.5},2,FALSE)

Kind regards

Saba
 
Upvote 0
Am I missing something here but looking at Saba's lookup table, do all the calculations boils down to being:-
=8 - Sum(Q20,U20,Y20)
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,731
Members
449,093
Latest member
Mnur

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