How to Use IF Statement with WORKDAY function

ExcelNoobUser

New Member
Joined
Jan 30, 2024
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hi, this is a continuation of my previous question a few days ago at this thread but I created a new post as I wanted to ask something different albeit related to that thread :How to use WORKDAY to calculate the Final Training Day and exclude Weekends and Public Holidays

I want to ask how to add in an IF Statement to work with the WORKDAY function where in column H, if it is blank, the WORKDAY function would work as normal but if there is a date in the cell i.e 11-May-18, that the output in the B column will be 11-May-18 unless it is blank in which it outputs as normal from the WORKDAY function. I created an IF statement =IF(H8<>"","H8","B8") and merged with the the WORKDAY function from the previous thread, =WORKDAY(G8,300/XLOOKUP(F8,$J$8:$J$13,$K$8:$K$13),$M$8:$M$25), but for some reason it still gives the same output as before instead of taking the output in the H column if it's not blank. Is there a way I can merge the IF statement with the WORKDAY function to get it to work as intended.
 

Attachments

  • after added in IF statement to WORKDAY.PNG
    after added in IF statement to WORKDAY.PNG
    23 KB · Views: 27

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
How about
Excel Formula:
=if(h8="",WORKDAY(G8,300/XLOOKUP(F8,$J$8:$J$13,$K$8:$K$13),$M$8:$M$25),h8)
 
Upvote 1
Solution
How about
Excel Formula:
=if(h8="",WORKDAY(G8,300/XLOOKUP(F8,$J$8:$J$13,$K$8:$K$13),$M$8:$M$25),h8)
It works now, thank you, if I may ask, why does it work when the IF statement is combined with the WORKDAY function instead of separately, as I initially combined the WORKDAY function with my original IF function with an & based on what I read on ablebits.
 
Upvote 0
If the formula is in col B, then your formula will return a circular reference.
 
Upvote 1
If the formula is in col B, then your formula will return a circular reference.
that was probably the reason why, thanks for taking the time to clarify, I was confused why using & originally didn't work
 
Upvote 0
You're welcome & thanks for the feedback.
 
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