#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Formula problem

I have the following formula to calculate a persons age based on todays date
in one column and their DOB in another, but I need to modify the formula so
if no DOB is listed, the formula returns a blank. Currently a blank in the
DOB column calculates to 108.

=DATEDIF(M2,K2,"Y")
I need to add something to this so I get a blank, not 108.

HELP!!!

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Formula problem

=IF(M2="","",DATEDIF(M2,K2,"Y"))


"GVegas" wrote:

I have the following formula to calculate a persons age based on todays date
in one column and their DOB in another, but I need to modify the formula so
if no DOB is listed, the formula returns a blank. Currently a blank in the
DOB column calculates to 108.

=DATEDIF(M2,K2,"Y")
I need to add something to this so I get a blank, not 108.

HELP!!!

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Formula problem

=IF(OR(M2="",K2=""),"",DATEDIF(M2,K2,"Y"))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"GVegas" wrote in message
...
I have the following formula to calculate a persons age based on todays
date
in one column and their DOB in another, but I need to modify the formula
so
if no DOB is listed, the formula returns a blank. Currently a blank in
the
DOB column calculates to 108.

=DATEDIF(M2,K2,"Y")
I need to add something to this so I get a blank, not 108.

HELP!!!

Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF-Then formula problem Bill Elerding Excel Worksheet Functions 6 March 25th 08 10:00 AM
Formula Problem Dave Excel Discussion (Misc queries) 2 December 11th 07 07:49 PM
Formula Problem Jeanette Excel Worksheet Functions 4 August 23rd 05 08:46 PM
Formula problem Mike Excel Worksheet Functions 2 July 20th 05 02:09 AM
Formula problem Giff Excel Discussion (Misc queries) 5 March 31st 05 11:23 PM


All times are GMT +1. The time now is 05:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"