Follow up Q to how to add a certain number of days to a date in excel

Report
-
TrowaD
Posts
2576
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 10, 2019
-
Hello,

Thank you for your article with the handy tip.

What way would one make use of to fill the contents of a single row (or column, depending how one has structured one's table) to follow a certain pattern.

ie. On an annual budget with a biweekly breakdown of anticipated expenses, I think it would be nifty to be able to say write a line of code to the effect of:

While the number of columns is less than or equal to 12, add 14 days to the first date entered into the row, store that date in a variable, print the computed date onto the cell beside it.

The output ought to be a neat row of dates that span a single year.

Would this be doable using a function or would it be better to use a VB script?

Thank you for looking into this for me.

Regards,

Izanagi

2 replies

Posts
2576
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 10, 2019
383
Hi Izanagi,

Not entirely sure I fully understand you.

Let's try a formula first.

This is how I imagined your request:
In column A you have dates. When 12 columns or less contain data, you want to add 14 days to the date in column A and place the new date in column B.

Formula in B2:
=IF(M2="",A2+14,"")

When column M contains data, more then 12 columns are used and column B remains empty.

Best regards,
Trowa