Vlookup and IF Statement

davewh

Board Regular
Joined
Aug 4, 2010
Messages
52
I'm trying to automate a spreadsheet that calculates pay rates based on weekend weekday and public holidays. I have column A as the date starting 01/01/2019 Column B has the formula =TEXT(A1,"dddd") to add the day.

Column C is a Vlookup to a Public Holidays table using the formula =IF(ISNA(VLOOKUP(A1,$G$2:$I$17,3,FALSE))," ",VLOOKUP(A1,$G$2:$I$17,3,FALSE)). Column D is an IF Statement to pull Columns B & C together =IF(C1="Bank Holiday",C1,B1). there is then another formula that calculates the pay rate depending the day

Does anyone know if there is a way to combine the IF(ISNA formula in Column C with the IF statement in Column D?

Many Thanks
Davewh
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Firstly, assuming that you are not using a real old version of Excel, this formula:
Code:
[COLOR=#333333]=IF(ISNA(VLOOKUP(A1,$G$2:$I$17,3,FALSE))," ",VLOOKUP(A1,$G$2:$I$17,3,FALSE))
can be simplified to this:
[/COLOR]
Code:
[COLOR=#333333]=IFERROR(VLOOKUP(A1,$G$2:$I$17,3,FALSE),"")
[/COLOR]

So, couldn't you just use:
Code:
[COLOR=#333333]=IFERROR(VLOOKUP(A1,$G$2:$I$17,3,FALSE),B1)
[/COLOR]
 
Upvote 0
You are welcome.
Glad I was able to help!
:)
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
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