Increment months?

Started by abssorb, February 23, 2021, 01:01:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

abssorb

I have a need (without VBA) to use formulae in the shapesheet to increment months. It's for a customised timeline, where there is a property that holds the start date and then successive shapes show the same dd with one month increments.

E.g. 5 Feb 2021, 5 Mar 2021, 5 Apr 2021,  for 18 months.

Such that if the first date changes, the rest change.  This is laughably trivial in excel but I can find no way to do it in Visio.
I've seen some solutions on the net, but they don't handle wrapping around year end, and I need 18 months in the timeline.

The closest I've got is to get the datevalue of the original date and multiply it by 30*<month shape number>.  Which works until February.  I could make an ugly IF for February but I'm hoping for something more elegant.   Short of convincing the planet to use a nice neat lunar calendar ;) 

Is there any way to make this work in Visio? Suggestions most welcome


Paul Herber

If the day, month and year are kept as separate data fields in Scratch, User or Shapedata then just the month can be incremented modulo 12, that'll give you 0..11, and use that value+1.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

wapperdude

However, just changing the month is insufficient.  Generally, the day number tracks, except at end of month.  So, Mar 31 -> Apr 31 = May 1st.  There will be special cases, unavoidable.  Feb just has more.
Visio 2019 Pro