IF & VLOOKUP on time value

salianne

New Member
Joined
Aug 3, 2022
Messages
23
Office Version
  1. 365
Platform
  1. Windows
On the following sheet. I have times formatted in hh:mm in column F. I want an IF and VLOOKUP function that states if the Paid Hrs (Column F) is <8, lookup the Dept Mo (Column D) and get the figure from Basic Rate (Colum M) and Multiply by Paid Hrs Mo; but if Paid Hrs Mo is more than 8 then lookup Dept Mo and get figure from OT rate column (Column N) multiply by the Paid Hrs Mo. Hope this makes sense. Am missing one part of my formula each time I do it. Any help appreciated.

1661194758015.png
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
where do you want the answer put

=if( f3 <8 , index( $M$3:$M$21, match ( d3, $L$3:$L$2, 0 )) , iF( f3 > 8 , index( $N$3:$N$21, match ( d3, $L$3:$L$2, 0 )) , "paid hours = 8" ))

=IF(F3<8,INDEX($M$3:$M$21,MATCH(D3,$L$2:$L$3,0)),IF(F3>8,INDEX($N$3:$N$21,MATCH(D3,$L$2:$L$3,0)),"paid hours = 8"))

what to do if paid hrs = 8

Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed
 
Upvote 0
where do you want the answer put

=if( f3 <8 , index( $M$3:$M$21, match ( d3, $L$3:$L$2, 0 )) , iF( f3 > 8 , index( $N$3:$N$21, match ( d3, $L$3:$L$2, 0 )) , "paid hours = 8" ))

=IF(F3<8,INDEX($M$3:$M$21,MATCH(D3,$L$2:$L$3,0)),IF(F3>8,INDEX($N$3:$N$21,MATCH(D3,$L$2:$L$3,0)),"paid hours = 8"))

what to do if paid hrs = 8

Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed
Thanks for your very detailed response. I want to multiply the Paid Hours by the the Basic Rate if the hours are <8(we can include the = here as well). If the hours are above 8, I want to multiply the OT Rate (Both based on the department). Does that make sense?
 
Upvote 0
=IF(F3<=8,INDEX($M$3:$M$21,MATCH(D3,$L$2:$L$3,0))*F3,IF(F3>8,INDEX($N$3:$N$21,MATCH(D3,$L$2:$L$3,0))*F3,"paid hours = 8"))

added the =
that returns the rate Basic Rate or OT rate - then i have added *F3
does that work now

so we can simplify now to
=IF(F3<=8,INDEX($M$3:$M$21,MATCH(D3,$L$2:$L$3,0))*F3,INDEX($N$3:$N$21,MATCH(D3,$L$2:$L$3,0))*F3)
as if its NOT <=8 - then assume its more

you could add ignore if employee blank
=IF(A3="","",IF(F3<=8,INDEX($M$3:$M$21,MATCH(D3,$L$2:$L$3,0))*F3,INDEX($N$3:$N$21,MATCH(D3,$L$2:$L$3,0))*F3))
 
Upvote 0
=IF(F3<=8,INDEX($M$3:$M$21,MATCH(D3,$L$2:$L$3,0))*F3,IF(F3>8,INDEX($N$3:$N$21,MATCH(D3,$L$2:$L$3,0))*F3,"paid hours = 8"))

added the =
that returns the rate Basic Rate or OT rate - then i have added *F3
does that work now

so we can simplify now to
=IF(F3<=8,INDEX($M$3:$M$21,MATCH(D3,$L$2:$L$3,0))*F3,INDEX($N$3:$N$21,MATCH(D3,$L$2:$L$3,0))*F3)
as if its NOT <=8 - then assume its more

you could add ignore if employee blank
=IF(A3="","",IF(F3<=8,INDEX($M$3:$M$21,MATCH(D3,$L$2:$L$3,0))*F3,INDEX($N$3:$N$21,MATCH(D3,$L$2:$L$3,0))*F3))
Column F is formatted as time (hh:mm)
 
Upvote 0
so multiply the time by 24

(F3*24)

But the table - of rates - is that also HH:MM as well -
if so what does that mean
 
Upvote 0
=IF(A3="","",IF((F3*24)<=8,INDEX($M$3:$M$21,MATCH(D3,$L$3:$L$21,0))*(F3*24),INDEX($N$3:$N$21,MATCH(D3,$L$3:$L$21,0))*(F3*24)))


Book3
ABCDEFGHIJKLMN
1
2
3frdep106:30:0065Dep110100
4frdep310:00:003000Dep220200
5 Dep330300
6
Sheet1
Cell Formulas
RangeFormula
G3:G5G3=IF(A3="","",IF((F3*24)<=8,INDEX($M$3:$M$21,MATCH(D3,$L$3:$L$21,0))*(F3*24),INDEX($N$3:$N$21,MATCH(D3,$L$3:$L$21,0))*(F3*24)))
 
Upvote 0
Solution

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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