Problem with multiple date testings in same formula

codys21

New Member
Joined
Jun 12, 2015
Messages
19
I am trying to make a formula that outputs the first of the month following six months. This is pretty easy until I get an end date that is less than the first of the month following six months. I'll show an example of my spreadsheet and hopefully this will be easier to understand.

Start Date End Date YearsMonthsDays
Assignment 111/3/20045/4/2005 0 6 2
Assignment 21/15/20063/16/2006 0 2 2
Assignment 33/15/2007 6/15/2007 0 3 1
Assignment 42/15/2009 10/15/2009 0 8 1

<colgroup><col><col span="4"><col></colgroup><tbody>
</tbody>


So, my formula is giving me 6/1/2005 because 5/4/2005 is at least six months greater than 11/3/2004 but since 6/1/2005 is greater than 5/4/2005, I do not want this output. What I would like is to output 9/1/2009 because it is at least six months greater than 2/15/2009 and also falls before 10/15/2009.

Right now I have this giving me the start date if there is at least six months until the end date:

=IF(ISBLANK($C$9),$B$9,IF($C$9>EDATE($B$9,6),$B$9,IF(ISBLANK($C$10),IF(ISBLANK($B$10),"Not Eligible",$B$10),IF($C$10>EDATE($B$10,6),$B$10,IF(ISBLANK($C$11),IF(ISBLANK($B$11),"Not Eligible",$B$11),IF($C$11>EDATE($B$11,6),$B$11,IF(ISBLANK($C$12),IF(ISBLANK($B$12),"Not Eligible",$B$12),IF($C$12>EDATE($B$12,6),$B$12,IF(ISBLANK($C$13),IF(ISBLANK($B$13),"Not Eligible",$B$13),IF($C$13>EDATE($B$13,6),$B$13,IF(ISBLANK($C$14),IF(ISBLANK($B$14),"Not Eligible",$B$14),IF($C$14>EDATE($B$14,6),$B$14,$B$14))))))))))))

and this taking that start date and giving me the first of the month following six months after the start date:

=IF($B$20="","",(((IF((DAY($B$20)=1),(DATE(YEAR((DATE(YEAR($B$20),MONTH($B$20),1))),MONTH((DATE(YEAR($B$20),MONTH($B$20),1)))+6,DAY((DATE(YEAR($B$20),MONTH($B$20),1))))),(DATE(YEAR((DATE(YEAR($B$20),MONTH($B$20),1))),MONTH((DATE(YEAR($B$20),MONTH($B$20),1)))+7,DAY((DATE(YEAR($B$20),MONTH($B$20),1))))))))))

So, like I mentioned earlier, this is giving me 6/1/2005 when instead I want 9/1/2009.

Any help would be greatly appreciated!
Thank you!
Cody
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I'm not totally clear what you're trying to do here, so this is a bit of a guess. Is it close?

B7: {=EOMONTH(INDEX(B2:B5,MATCH(TRUE,EOMONTH(B2:B5-1,6)+1<=C2:C5,))-1,6)+1} array-entered

Excel 2010
ABCDEF
1Start DateEnd DateYearsMonthsDays
2Assignment 13 Nov 044 May 05062
3Assignment 215 Jan 0616 Mar 06022
4Assignment 315 Mar 0715 Jun 07031
5Assignment 415 Feb 0915 Oct 09081
6
7Result1 Sep 09
8
9Start DateEnd DateYearsMonthsDays
10Assignment 13 Nov 044 May 05062
11Assignment 215 Jan 0616 Sep 06082
12Assignment 315 Mar 0715 Jun 07031
13Assignment 415 Feb 0915 Oct 09081
14
15Result1 Aug 06
16
17Start DateEnd DateYearsMonthsDays
18Assignment 13 Nov 044 Jun 05072
19Assignment 215 Jan 0616 Mar 06022
20Assignment 315 Mar 0715 Jun 07031
21Assignment 415 Feb 0915 Oct 09081
22
23Result1 Jun 05

<tbody>
</tbody>
Sheet1
 
Upvote 0
I'm not totally clear what you're trying to do here, so this is a bit of a guess. Is it close?

B7: {=EOMONTH(INDEX(B2:B5,MATCH(TRUE,EOMONTH(B2:B5-1,6)+1<=C2:C5,))-1,6)+1} array-entered

Excel 2010
ABCDEF
1Start DateEnd DateYearsMonthsDays
2Assignment 13 Nov 044 May 05062
3Assignment 215 Jan 0616 Mar 06022
4Assignment 315 Mar 0715 Jun 07031
5Assignment 415 Feb 0915 Oct 09081
6
7Result1 Sep 09
8
9Start DateEnd DateYearsMonthsDays
10Assignment 13 Nov 044 May 05062
11Assignment 215 Jan 0616 Sep 06082
12Assignment 315 Mar 0715 Jun 07031
13Assignment 415 Feb 0915 Oct 09081
14
15Result1 Aug 06
16
17Start DateEnd DateYearsMonthsDays
18Assignment 13 Nov 044 Jun 05072
19Assignment 215 Jan 0616 Mar 06022
20Assignment 315 Mar 0715 Jun 07031
21Assignment 415 Feb 0915 Oct 09081
22
23Result1 Jun 05

<tbody>
</tbody>
Sheet1


That is exactly the result I want! Except I don't understand how you did it with the array, sorry.
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,178
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top