+ Reply to Thread
Results 1 to 5 of 5

Return a text based on today's date (not considering year)

  1. #1
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Question Return a text based on today's date (not considering year)

    Hi there,

    Struggling to build a straight forward formula to return a text based on a date, so I'm kindly asking your suggestion:

    - if today is between the 29th of December until the 28th of April, return "28th April".
    - if today is between the 29th of April until the 28th of July, return "28th July".
    - if today is between the 29th of July until the 28th of October, return "28th October".
    - if today is between the 29th of October until the 28th of December, return "28th December".

    My main struggle to build this formula is because =today() also returns year, but this formula should not be based on the year, but only day and month.

    Any suggestion?

    Thanks!

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Return a text based on today's date (not considering year)

    Try this:

    =LOOKUP(TODAY()-(DATE(2018,1,1)-2),{0,120,211,303},{"28th April","28th July","28th October","28th December"})
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Return a text based on today's date (not considering year)

    Hi Glenn, thanks for your reply.

    It doesn't work if the year is 2019 or greater.
    Anything greater than 29/10/18 (for example, 01/01/2019) gets stuck in "28th December".

    Any idea how to fix that?

    Cheers

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,914

    Re: Return a text based on today's date (not considering year)

    Or try:

    =LOOKUP(MONTH(EDATE(A1-28,1)),{1,5,8,11},{"28th April","28th July","28th October","28th December"})

    A1 =Today()

  5. #5
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Return a text based on today's date (not considering year)

    Work like a charm. Thank you!
    Last edited by ricdamiani; 02-05-2018 at 07:21 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calculating year in past and future based on today's date
    By larryd9466 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-09-2016, 01:04 PM
  2. [SOLVED] Return different values in a cell from different column ranges, based on today`s date
    By schmidta1988 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-03-2016, 07:07 AM
  3. [SOLVED] Help with formula to return a value based on if that expiry date is within year
    By mw91 in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 01-08-2015, 11:37 AM
  4. [SOLVED] Formula to compare date (including month and year) from a listed date to today's date
    By mhewitson15 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2014, 05:31 PM
  5. Replies: 5
    Last Post: 01-29-2014, 09:49 PM
  6. [SOLVED] Search a table and return value based on today's date
    By her.rockstar in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 05-16-2013, 10:29 AM
  7. formula to return a year based on a date range
    By bankster in forum Excel General
    Replies: 12
    Last Post: 03-30-2012, 04:24 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1