Work around leap year in formula and display appropriate dates (if?)

dnelley

New Member
Joined
Apr 25, 2014
Messages
5
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I would like a formula that could generate the following outputs


ABACADAEAFAGAHAIAJAKALAMANAO
ex:12/1/142/8/142/15/142/22/143/1/143/8/143/15/143/22/143/29/144/1/144/8/14
ex:22/1/162/8/162/15/162/22/162/29/163/1/163/8/163/15/163/22/163/29/164/1/164/8/16

<tbody>
</tbody>


I am having a hard time creating a formula the would produce the above

I have tried to create the above using nested if statements -- but after a few cells my formula no longer gives valid results

here's what I had tried to use:
IF(AC158=FALSE, EOMONTH(AB158,0)+1, IF(MONTH(AC158+7)=MONTH(AC158), AC158+7, IF(((EOMONTH(AB158,-1)+1)+(4*7))=(AC158+7), EOMONTH(AB158,0)+1, FALSE))) == cell AD158
the formula is dragged to the right

this one almost works but i get too many or too few empty("FALSE") cells than I want

ABACADAEAFAGAHAIAJAKALAMANAO
ex:11582/1/14
2/8/142/15/142/22/143/1/143/8/143/15/143/22/143/29/144/1/164/8/144/15/16
ex:21582/1/16
2/8/162/15/162/22/162/29/163/1/163/8/163/15/163/22/163/29/164/1/16

<tbody>
</tbody>


here's another one
IF(MONTH(AC174+7)=MONTH(AC174), AC174+7, IF(((EOMONTH(AB174,-1)+1)+(4*7))=(AC174+7), EOMONTH(AB174,0)+1, IF(AC174=FALSE, EOMONTH(AB174,0)+1, FALSE))) == cell AD174



ABACADAEAFAGAHAIAJAKALAMANAO
ex:11742/1/14
2/8/142/15/142/22/143/1/143/8/143/15/143/22/143/29/141/7/001/14/001/21/00
ex:21742/1/16
2/8/162/15/162/22/162/29/161/7/001/14/001/28/00#num#num#num#num

<tbody>
</tbody>


another fail:
IF(AC135=FALSE, (EOMONTH(AB135,0))+1, IF(MONTH(AC135+7)=MONTH(AC135), AC135+7, FALSE))== cell AD174



ABACADAEAFAGAHAIAJAKALAMANAO
ex:11352/1/14
2/8/142/15/142/22/143/1/143/8/143/15/143/22/143/29/144/1/144/8/14
ex:21352/1/16
2/8/162/15/162/22/162/29/163/1/163/8/163/15/163/22/163/29/164/1/16

<tbody>
</tbody>



I'm trying to display five weeks for every month and since february doesn't consistently have five weeks I need my formula to recognize this,
ultimately i would like to generate a gantt table around these outputs

any insight/assistance is welcomed


Thanks :Dee
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi,

I am not sure what you are trying to do. No month has a complete five weeks. If it did there could be 60 weeks in a year and not 52 and a bit.

Why do you want to have some dates 7 days apart and some only 1 day apart?
 
Upvote 0
Hello Dee,

I used this formula for AD2

=IF(AC2=FALSE,EOMONTH(AB2,0)+1,IF(MONTH(AC2+7)=MONTH(AC2),AC2+7,IF(DAY(AC2)=22,FALSE,EOMONTH(AC2,0)+1)))

does that work for you?
 
Upvote 0

Forum statistics

Threads
1,215,540
Messages
6,125,405
Members
449,223
Latest member
Narrian

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