Home » excel » excel – Using VLOOKUP multiple times in an IF statement

excel – Using VLOOKUP multiple times in an IF statement

Posted by: admin May 14, 2020 Leave a comment

Questions:

I need to calculate the Gross based on a table that’s on a different sheet. The thing I’m having a problem with is the fact that there are 7 different job levels that all receive different pay rates, and those with a job level of 7 and higher do not get paid overtime.

(I wrote out the data type instead of the cells themselves in an attempt to make what I have so far easier to understand):

=IF(JobLevel>6*(VLOOKUP(JobLevel,data!$B$5:$C$13,2,FALSE))*(RegularHours),+(HourlyRate*(OvertimeHours*1.5))

How can I even calculate the hourly rate for a second time for those who DO get paid overtime? Can I insert another VLOOKUP?

How to&Answers:

Your conditions lack commas to separate logical differences and this might be better as,

=VLOOKUP(JobLevel, data!$B$5:$C$13, 2, FALSE)*RegularHours+(HourlyRate*OvertimeHours*1.5*(JobLevel<7))

If JobLevel is greater than 6 the boolean is false (zero) and anything multiplied against a zero is zero.