Fixing #Value error message

Detectiveclem

Active Member
Joined
May 31, 2014
Messages
320
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Help please, I am using the following formula which works perfectly when someone enters their actual date of birth in cell D18, but until they do I want the text as shown below to show in cell D18, but do not want the error code shown to appear. I would prefer it remained blank or said "Auto Polulated".

I have tried playing with IFERROR but can't find the correct way to write the formula. Any help would be greatly appreciated.

=IF(D18>0,DATEDIF(D18,TODAY(),"Y"),"")

1606291262770.png
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
hi detectiveclem,
The syntax of your formula appears to be correct and should not show any errors. in case if it does, then use the below:

Excel Formula:
=iferror(IF(D18>0,DATEDIF(D18,TODAY(),"Y"),""),"")

hope it helps.

P.s. if this does not perform as required, then I would suggest sharing your worksheet via xl2bb.
 
Upvote 0
Another option
Excel Formula:
=IF(ISNUMBER(D18),DATEDIF(D18,TODAY(),"Y"),"")
This way you will still get an error if somebody puts in a date in the future.
 
Upvote 0
Another option
Excel Formula:
=IF(ISNUMBER(D18),DATEDIF(D18,TODAY(),"Y"),"")
This way you will still get an error if somebody puts in a date in the future.
Hi again Fluff,

The solution provided by fadee2 works. Will your solution work if someone makes a mistake and puts a date in the future?
 
Upvote 0
It will show an error if the date is in the future, thereby alerting you to the fact that there is a problem.
Which option you use is down to personal preference.
 
Upvote 0
It will show an error if the date is in the future, thereby alerting you to the fact that there is a problem.
Which option you use is down to personal preference.
Thanks fluff, I would prefer an error message
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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