Consulting

Results 1 to 3 of 3

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

  1. #1
    VBAX Regular
    Joined
    Mar 2020
    Posts
    25
    Location

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

    Hello VBA Express community, I have a task at hand with excel and i'm not too sure how to do it.
    Screenshot_2.jpg

    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:
    report.xlsx
    Last edited by Zaxest; 04-02-2020 at 03:19 AM.

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    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.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Mar 2020
    Posts
    25
    Location
    Quote Originally Posted by SamT View Post
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •