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

Closed
Izanagi7 - Jul 4, 2019 at 09:44 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jul 8, 2019 at 11:35 AM
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
Related:

1 response

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 555
Jul 8, 2019 at 11:35 AM
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
0