Date Formula Error

francoiscj1

New Member
Joined
Aug 21, 2017
Messages
33
Office Version
  1. 365
Platform
  1. Windows
The following formula is in my Column N:

=IFERROR(IF(OR(ISNUMBER(SEARCH("Expedite",D4)),ISNUMBER(SEARCH("Urgent",D4))),I4,WORKDAY(MAX(IF(ISNUMBER(I4),I4,H4),J4,K4,L4,M4),IF(G4="Annual",WORKDAY(EDATE(I4,12),1,Control!$A$1:$A$13),IF(G4="Every 2 Years",WORKDAY(EDATE(I4,24),1,Control!$A$1:$A$13),IF(G4="Every 3 Years",WORKDAY(EDATE(I4,36),1,Control!$A$1:$A$13),""))))),"")

For example, in N4, the date should be calculating three years from the date in I4 (11/29/2026). There is no date for H4 since the potential employee began work in 2023. What am I doing wrong?

Attached is a screenshot.
 

Attachments

  • Picture1.png
    Picture1.png
    219.5 KB · Views: 15

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
The first time you are using WORKDAY, the first argument is a date, then the second argument is supposed to be a number of days. But in your formula, it's the date that you calculate in the last WORKDAY. So I think you have your parentheses jumbled up.

I'm not sure what the correction is because I don't know what you are trying to do.

What is the number of days you want to use if D4 is Expedite or Urgent?

Here is how your formula is being evaluated for that row (an excellent debug tool that you should learn)
1701448427985.png


The date is calculated correctly here as 11/30/2026, in your last WORKDAY
1701448468427.png


But on completion that result is used as the # of days in the first call to WORKDAY, giving you a date 46,356 days after 11/29/2023.
1701448526261.png
 

Attachments

  • 1701448446434.png
    1701448446434.png
    3.2 KB · Views: 6
Upvote 0
If the "Expedite" or "Urgent" is in D4, the course should be done on the same day.

What I'm trying to do is each time a date is inserted in H4:M4, the formula in N4 is reflected to calculate the frequency in G4
 
Upvote 0
I am guessing that on the Control page in cells A1:A13 you have your holidays. Then... how about this?:

DateFormulaError.xlsx
DEFGHIJKLMN
3ValueFrequencyFY22FY23FY24FY25FY26FY27Retraining date
4Every 3 Years29/11/202330/11/2026
5Annual30/08/202330/08/2024
6Once14/11/2023 
7Annual16/11/202318/11/2024
8Every 2 Years16/11/202317/11/2025
9Annual28/11/202328/11/2024
10Annual14/11/202314/11/2024
Hoja1
Cell Formulas
RangeFormula
N4:N10N4=IFERROR(IF(OR(D4="Expedite",D4="Urgent"),I4,WORKDAY(EDATE(MAX(H4:M4),IF(G4="Annual",12,IF(G4="Every 2 Years",24,IF(G4="Every 3 Years",36))))-1,1,Control!$A$1:$A$13)),"")
 
Upvote 0
Solution
I am guessing that on the Control page in cells A1:A13 you have your holidays. Then... how about this?:

DateFormulaError.xlsx
DEFGHIJKLMN
3ValueFrequencyFY22FY23FY24FY25FY26FY27Retraining date
4Every 3 Years29/11/202330/11/2026
5Annual30/08/202330/08/2024
6Once14/11/2023 
7Annual16/11/202318/11/2024
8Every 2 Years16/11/202317/11/2025
9Annual28/11/202328/11/2024
10Annual14/11/202314/11/2024
Hoja1
Cell Formulas
RangeFormula
N4:N10N4=IFERROR(IF(OR(D4="Expedite",D4="Urgent"),I4,WORKDAY(EDATE(MAX(H4:M4),IF(G4="Annual",12,IF(G4="Every 2 Years",24,IF(G4="Every 3 Years",36))))-1,1,Control!$A$1:$A$13)),"")
Thank you so much!! It worked!!!
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,182
Members
452,615
Latest member
bogeys2birdies

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