PDA

View Full Version : How do i add a string in a column like "1 week" or "12 months" into cell with a date



Zaxest
04-02-2020, 12:25 AM
Hello VBA Express community, I have a task at hand with excel and i'm not too sure how to do it.
26256

So basically in column B, there is a date in every cell.
In column G, a description with a string that i need which is the duration of exception is stored. ( In the first row's case, 1 week.)
The values for exceptions are : 1 week, 2 weeks, 3 weeks, 1 month, 2 months, 3 months, 6 months and 12 months.
With the string "1 week" that i managed to extract, how do i add this "1 week" string onto the date in Column B and compare it with today's current date, whilst determining which date is greater?
If today's date is greater, return the string "Expired" and if not, return "Not Expired".
New columns may be created, but keep it to the minimum.
Thank you so much !

here is the excel sheet:
26257

SamT
04-02-2020, 08:37 AM
return the string "Expired" and if not, return "Not Expired".
Return the String Where?

I'm sure that an Excel Formula guru can do it in your Workbook, But I, personally, would have to use VBA in a Macro enabled workbook.

Zaxest
04-02-2020, 08:58 AM
Return the String Where?

I'm sure that an Excel Formula guru can do it in your Workbook, But I, personally, would have to use VBA in a Macro enabled workbook.

return the resulting string in a new column
thanks for your time.