![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 45
|
I am in need of some help in rounding dates. For example: Cell A1 has 02/25/03 and cell B1 has 90 (days). Cell C1 should be 06/01/03 because 90 days added to 02/25/03 is 05/26/03, yet it rounds to the nearest month (06/01/03). Am I making sense??? Help!
Thanks Christal |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
=A1+B1 gives 05/26/03 (26-May-03) in C1. |
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
=EOMONTH(A1+B1,IF(DAY(A1+B1)>=15,0,-1))+1
Note: The EMONTH worksheet function is supplied by the Analysis ToolPak add-in. [ This Message was edited by: Mark W. on 2002-04-08 07:31 ] |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Posts: 45
|
Can you tell me what to use in the tool pak in order for this calculation to work??
Thanks! |
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
|
|
|
|
|
|
|
#6 | |
|
New Member
Join Date: Apr 2002
Posts: 7
|
Quote:
You cannot really round dates the way you round other numbers.. Here's a non ATP answer that will return the same as the answer you received from Mark =DATE(YEAR(A1+B1),MONTH(A1+B1)+IF(DAY(A1+B1)>=15,1,0),1) otherwise see Aladin's answer, if you add 90 days to 02/25/03 the result is 05/26/03, not 06/01/03.. Regards, Peo Sjoblom |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|