Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Another date formula

Here's my data:

A B
1 1-Jun-08 1-Jul-08
2 30-Jun-08 31-Jul-08

I need a formula in B1 and B2 that will:

If col A date is first day of month then return first day of next month; or
If col A date is last day of month then return last day of next month.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 293
Default Another date formula

Hi nibbana,

For A1/B1:
=DATE(Year(A1),MONTH(A1)+1,1)
For A2/B2:
=DATE(Year(A2),MONTH(A1)+2,0)

--
Cheers
macropod
[MVP - Microsoft Word]


"nibbana" wrote in message ...
Here's my data:

A B
1 1-Jun-08 1-Jul-08
2 30-Jun-08 31-Jul-08

I need a formula in B1 and B2 that will:

If col A date is first day of month then return first day of next month; or
If col A date is last day of month then return last day of next month.

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 222
Default Another date formula

In B1 and copied down:

=IF(MONTH((DATE(YEAR(A1),MONTH(A1),DAY(A1))+1))MO NTH(A1),
DATE(YEAR(A1),MONTH(A1)+2,1)-1,
DATE(YEAR(A1),MONTH(A1)+1,DAY(A1)))

--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"nibbana" wrote:

Here's my data:

A B
1 1-Jun-08 1-Jul-08
2 30-Jun-08 31-Jul-08

I need a formula in B1 and B2 that will:

If col A date is first day of month then return first day of next month; or
If col A date is last day of month then return last day of next month.

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 222
Default Another date formula

We don't have to work so hard on the IF test:

=IF(MONTH(A1+1)MONTH(A1),
DATE(YEAR(A1),MONTH(A1)+2,1)-1,
DATE(YEAR(A1),MONTH(A1)+1,DAY(A1)))

--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"nibbana" wrote:

Here's my data:

A B
1 1-Jun-08 1-Jul-08
2 30-Jun-08 31-Jul-08

I need a formula in B1 and B2 that will:

If col A date is first day of month then return first day of next month; or
If col A date is last day of month then return last day of next month.

Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Another date formula

Turns out I don't need the if scenario. so these simple ones worked great,
thanks.

"macropod" wrote:

Hi nibbana,

For A1/B1:
=DATE(Year(A1),MONTH(A1)+1,1)
For A2/B2:
=DATE(Year(A2),MONTH(A1)+2,0)

--
Cheers
macropod
[MVP - Microsoft Word]


"nibbana" wrote in message ...
Here's my data:

A B
1 1-Jun-08 1-Jul-08
2 30-Jun-08 31-Jul-08

I need a formula in B1 and B2 that will:

If col A date is first day of month then return first day of next month; or
If col A date is last day of month then return last day of next month.

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
Date Formula Problem - Leave date blank if Null Gayla Excel Worksheet Functions 5 April 24th 07 09:42 PM
Create a formula in a date range to locate a specific date - ecel util Excel Discussion (Misc queries) 0 February 19th 07 03:03 PM
Excel Formula to calulate number of days passed from date to date K. Mack Excel Discussion (Misc queries) 8 January 4th 07 11:27 PM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Worksheet Functions 2 April 21st 06 02:50 AM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Discussion (Misc queries) 1 April 20th 06 10:03 PM


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