Share via

Setup/generate upcoming Due Dates Conditionally

Anonymous
2024-09-14T08:11:05+00:00
Invoice.ID Upcoming Due Date(Results)
AA-001 15-09-2024
BB-001 30-09-2024
AA-002 15-09-2024
CC-001 due dates lapsed
DD-001 30-11-2024
BB-003 30-09-2024
DD-002 30-11-2024
CC-002 due dates lapsed
EE-001 30-09-2024
EE-002 30-09-2024

Based on today's date all upcoming due dates be generated and all dates are to be in dd-mm-yyyy format. As in cell B1 Inv.Id starts with AA corresponding fortnight ends on 15-09-2024 as per today' date. The moment current date changes to 16-09-2024 upcoming date be changed to end fortnight date of current month i.e to 30-09-2024. What formula will yield results as given in column C.

Condition helper Table:(only for conditions explanation)

invoice ids category due date periods
invoice id starts with AA Fortnightly
" " BB Monthly
"" "" CC JAN, JUL
"" "" DD FEB,MAY,AUG,,NOV
"" "" EE MAR,JUN,SEP,DEC
Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2024-09-14T10:39:32+00:00

In C2:

=SWITCH(LEFT(B2, 2), 
  "AA", IF(DAY(TODAY())<16, DATE(YEAR(TODAY()), MONTH(TODAY()), 15), EOMONTH(TODAY(), 0)), 
  "BB", EOMONTH(TODAY(), 0), 
  "CC", EOMONTH(TODAY(), 5-MOD(MONTH(TODAY())+4, 6)), 
  "DD", EOMONTH(TODAY(), 2-MOD(MONTH(TODAY()), 3)), 
  "EE", EOMONTH(TODAY(), 2-MOD(MONTH(TODAY())-1, 3)))

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2024-09-14T17:49:45+00:00

    Thank You HansV, Million thanks ,trying to understand the logical calculation you have used in this function. Million thanks once again.

    Was this answer helpful?

    0 comments No comments