Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick
 
Posts: n/a
Default #NUM! in Date field calculation

Great site for help!
I have 3 cells.
A1 is a date cell (formatted for date mmm/yy) in which I input a start date.
A2 is a numeric value representing the length of a project in months.
A3 contains this formula =(DATE(YEAR(A1),MONTH(A1)+(A2-1),DAY(A1)) and is
formatted as a date cell.

It works to a fashion except it returns #NUM! when there is nothing in cell
A1 & A2.

How do I fix this or get around it?
I want the cell A3 to show nothing unless both A1 & A2 have inputs.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default #NUM! in Date field calculation

Rick, it is supposed to return #NUM!. When A1 and A2 are blank your
function essentially becomes =DAY(0, 0, 0). When you input values in
these two cells, Excel will recalculate and produce a result
automatically.

If you want to avoid displaying an error value (and display, say, an
empty cell instead), use the following formula:

=IF(OR(A1=0, A2=0), "", DATE(YEAR(A1),MONTH(A1)+(A2-1),DAY(A1))

HTH
Kostis Vezerides

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default #NUM! in Date field calculation

One way

=IF(COUNT(A1:A2)<2,"",(DATE(YEAR(A1),MONTH(A1)+(A2-1),DAY(A1))))


--

Regards,

Peo Sjoblom

"Rick" wrote in message
...
Great site for help!
I have 3 cells.
A1 is a date cell (formatted for date mmm/yy) in which I input a start

date.
A2 is a numeric value representing the length of a project in months.
A3 contains this formula =(DATE(YEAR(A1),MONTH(A1)+(A2-1),DAY(A1)) and is
formatted as a date cell.

It works to a fashion except it returns #NUM! when there is nothing in

cell
A1 & A2.

How do I fix this or get around it?
I want the cell A3 to show nothing unless both A1 & A2 have inputs.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick
 
Posts: n/a
Default #NUM! in Date field calculation

Thanks for the help...works great!

"vezerid" wrote:

Rick, it is supposed to return #NUM!. When A1 and A2 are blank your
function essentially becomes =DAY(0, 0, 0). When you input values in
these two cells, Excel will recalculate and produce a result
automatically.

If you want to avoid displaying an error value (and display, say, an
empty cell instead), use the following formula:

=IF(OR(A1=0, A2=0), "", DATE(YEAR(A1),MONTH(A1)+(A2-1),DAY(A1))

HTH
Kostis Vezerides


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick
 
Posts: n/a
Default #NUM! in Date field calculation

Thanks for your help...it works great, also.

"Peo Sjoblom" wrote:

One way

=IF(COUNT(A1:A2)<2,"",(DATE(YEAR(A1),MONTH(A1)+(A2-1),DAY(A1))))


--

Regards,

Peo Sjoblom

"Rick" wrote in message
...
Great site for help!
I have 3 cells.
A1 is a date cell (formatted for date mmm/yy) in which I input a start

date.
A2 is a numeric value representing the length of a project in months.
A3 contains this formula =(DATE(YEAR(A1),MONTH(A1)+(A2-1),DAY(A1)) and is
formatted as a date cell.

It works to a fashion except it returns #NUM! when there is nothing in

cell
A1 & A2.

How do I fix this or get around it?
I want the cell A3 to show nothing unless both A1 & A2 have inputs.




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
Capturing a date field once only Rob Svilts Excel Worksheet Functions 2 October 27th 05 01:22 PM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM
HELP - Date Range In 1 Cell Calculation Adam Excel Worksheet Functions 6 September 19th 05 08:24 PM
date calculation issues mike richard Excel Worksheet Functions 1 June 13th 05 08:12 PM
Keeping date format of a field inserted from an excel database Tim Cossins Excel Worksheet Functions 1 May 21st 05 12:49 AM


All times are GMT +1. The time now is 01:46 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"