IF cell zero, DATEDIF/12

ozbeachbum

Board Regular
Joined
Jun 3, 2015
Messages
161
Office Version
  1. 2021
Platform
  1. Windows
Apologies for there being no Mini Sheet, even with all the help from members, does not look like there is a solution to the issue.

I have the following formulae which I need to include an IF statement and both in the one formula;

(1): DATEDIF(P88,'[01 REGISTER holding co.xlsx]Holding Company List'!N88,"M")/12
(2): DATEDIF(P88,$P$57,"M")/12

IF(J88>0,(1),(2)

Individually 1 & 2 give me the correct answer, however I have been unable to work out how to combine them with the IF statement.
Any assistance greatly appreciated.
Cheers,
Dave.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I'm not clear on the problem, but the first problem I see is "IF(J88>0,(1),(2)". The formula should be
Excel Formula:
=IF(J88>0,1,2)
No need for all those parenthesis. And (1) can't be a named range, so it's unclear what the formula is supposed to be.

And why use (the unsupported but I'm impressed you know it) DATEDIF instead of just subtracting the dates and dividing by 365 ( or 365.25!) and either rounding it or just using the INT of it?

Just asking!
 
Upvote 0
Solution
What part of your formula failed?
What values are in the referenced cells?
Try Formulas Formula Evaluate to see the results

=IF(J88>0,DATEDIF(P88,'[01 REGISTER holding co.xlsx]Holding Company List'!N88,"M")/12,DATEDIF(P88,$P$57,"M")/12))
 
Upvote 0
Thank you so much, you made me realise that I had a parenthesis that was not needed.
=IF(J88>0,DATEDIF(P88,'[01 REGISTER holding co.xlsx]Holding Company List'!$N$88,"M")/12),DATEDIF(P88,$P$57,"M")/12)
Solved
=IF(J88>0,DATEDIF(P88,'[01 REGISTER holding co.xlsx]Holding Company List'!$N$88,"M")/12,DATEDIF(P88,$P$57,"M")/12)
To answer your question, the reason I am using DATEDIF is because my research indicated that it would return the time period as a decimal, which is what I was trying achieve at the time.
Thanks again,
Dave.
 
Upvote 0
Thanks Dave,
As you can see jdellasala put me on the right track to your solution.
Cheers,
Dave.
 
Upvote 0

Forum statistics

Threads
1,215,366
Messages
6,124,514
Members
449,168
Latest member
CheerfulWalker

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