ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   If date in column A is less than 15th of month can I display next. (https://www.excelbanter.com/excel-discussion-misc-queries/165097-if-date-column-less-than-15th-month-can-i-display-next.html)

Angela

If date in column A is less than 15th of month can I display next.
 
If date in column A is less than 15th of month is there a formula I can use
to display the next mth in column B such that I can obtain the following

Column A Column B
05-Oct-07 Oct-07
05-Nov-07 Nov-07
15-Oct-07 Nov-07
19-Nov-07 Dec-07

Thanks
--
Angela

Max

If date in column A is less than 15th of month can I display next.
 
One way

In B1:
=IF(A1="","",IF(DAY(A1)=15,DATE(YEAR(A1),MONTH(A1 )+1,1),DATE(YEAR(A1),MONTH(A1),1)))
Format B1 as custom, type: mmm-yy. Copy down.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Angela" wrote:
If date in column A is less than 15th of month is there a formula I can use
to display the next mth in column B such that I can obtain the following

Column A Column B
05-Oct-07 Oct-07
05-Nov-07 Nov-07
15-Oct-07 Nov-07
19-Nov-07 Dec-07

Thanks
--
Angela


Angela

If date in column A is less than 15th of month can I display n
 
Bloody marvelous

Thank you
--
Angela


"Max" wrote:

One way

In B1:
=IF(A1="","",IF(DAY(A1)=15,DATE(YEAR(A1),MONTH(A1 )+1,1),DATE(YEAR(A1),MONTH(A1),1)))
Format B1 as custom, type: mmm-yy. Copy down.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Angela" wrote:
If date in column A is less than 15th of month is there a formula I can use
to display the next mth in column B such that I can obtain the following

Column A Column B
05-Oct-07 Oct-07
05-Nov-07 Nov-07
15-Oct-07 Nov-07
19-Nov-07 Dec-07

Thanks
--
Angela


Max

If date in column A is less than 15th of month can I display n
 
Welcome. Thanks for the feedback.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Angela" wrote in message
...
Bloody marvelous

Thank you
--
Angela




Dave Peterson

If date in column A is less than 15th of month can I display next.
 
Another version based on Max's idea:

=IF(A1="","",DATE(YEAR(A1),MONTH(A1)+(DAY(A1)=15) ,1))

(day(a1)=15) will return True or false.
When added to a number (like month(a)), it's like adding 1 (true) or 0 (false).





Angela wrote:

If date in column A is less than 15th of month is there a formula I can use
to display the next mth in column B such that I can obtain the following

Column A Column B
05-Oct-07 Oct-07
05-Nov-07 Nov-07
15-Oct-07 Nov-07
19-Nov-07 Dec-07

Thanks
--
Angela


--

Dave Peterson


All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com