+ Reply to Thread
Results 1 to 10 of 10

Count days from TODAY() until text in adjacent cell changes

  1. #1
    Registered User
    Join Date
    11-19-2019
    Location
    Europe
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Count days from TODAY() until text in adjacent cell changes

    Hi all,

    I'm making a travel plan, where I would like my sheet to calculate when the next destination changes from TODAY(). I've attached a picture and sheet which exemplify the issue at hand.

    FrJXxwu.png

    Thanks in advance.
    Attached Files Attached Files
    Last edited by Enounce; 05-16-2021 at 05:44 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,921

    Re: Count days from TODAY() until text in adjacent cell changes

    Will this work for you?

    =IF(COUNTIF(B$2:B2,B2)=1,COUNTIF($B$2:$B$20,B2),"")

    You may need this if your locale is a European one:

    =IF(COUNTIF(B$2:B2;B2)=1;COUNTIF($B$2:$B$20;B2);"")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-19-2019
    Location
    Europe
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: Count days from TODAY() until text in adjacent cell changes

    Hi AliGW,

    Thanks for the feedback!

    The formula goes in a status field that will need to update depending on today(), lookup the destination, find when the destination updates, and then calculate the number of days between the two destinations. Edit: Just tried adding a photo to explain a bit better. So for instance, tomorrow the field would need to show "3", and so forth.

    EDucvsM.png

    I'm not sure if that made it any clearer, otherwise, let me know.
    Last edited by Enounce; 05-16-2021 at 09:20 AM.

  4. #4
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: Count days from TODAY() until text in adjacent cell changes

    Formula =COUNTIF(INDIRECT("B"&MATCH(TODAY(),C:C,0)&":B10000"),INDEX(B:B,MATCH(TODAY(),C:C,0)))
    You may need to replace comma with semicolon for Europe

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Count days from TODAY() until text in adjacent cell changes

    Another option
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-19-2019
    Location
    Europe
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: Count days from TODAY() until text in adjacent cell changes

    Quote Originally Posted by josephteh View Post
    Formula =COUNTIF(INDIRECT("B"&MATCH(TODAY(),C:C,0)&":B10000"),INDEX(B:B,MATCH(TODAY(),C:C,0)))
    You may need to replace comma with semicolon for Europe
    I actually thought this one worked but by coincidence, I typed in the same destination a bit further down which made the count increase, which it ideally shouldn't. It has to "break" whenever a value interrupts the streak.

    rao3tNz.png

    Quote Originally Posted by Fluff13 View Post
    Another option
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Unfortunately, same as above. I also suspect Xmatch will cause issues for my travel buddy. He's on an older version.

    Thanks for all the suggestions, and sorry for not realizing that destinations could appear multiple times.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,921

    Re: Count days from TODAY() until text in adjacent cell changes

    I typed in the same destination a bit further down which made the count increase, which it ideally shouldn't. It has to "break" whenever a value interrupts the streak.
    Where in your opening post did you state this as a requirement?

    Provide a larger set of sample data with results mocked up by hand. Make sure it covers all eventualities.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Count days from TODAY() until text in adjacent cell changes

    Ok, how about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    11-19-2019
    Location
    Europe
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: Count days from TODAY() until text in adjacent cell changes

    Quote Originally Posted by AliGW View Post
    Where in your opening post did you state this as a requirement? Provide a larger set of sample data with results mocked up by hand. Make sure it covers all eventualities.
    I agree with you completely, I simply hadn't thought of it at the time of asking, hence my apology.
    Quote Originally Posted by Enounce View Post
    (...) sorry for not realizing that destinations could appear multiple times.
    I really do try to provide all feedback and illustrate through sample data and images. I'll try to do even better next time.


    Quote Originally Posted by Fluff13 View Post
    Ok, how about
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This one works flawlessly. Thanks so much, Fluff13!

    My buddy uploaded the sheet to a Google Drive, but apparently, the AGGREGATE function isn't available there. Am I allowed to ask for a Google-proof formula as well here, or should I open a new topic in the other platforms section?

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Count days from TODAY() until text in adjacent cell changes

    Glad to help & thanks for the feedback.

    I don't know much about Google, so cannot help with that.

+ 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. [SOLVED] If cell contains Today() return adjacent cell with Text
    By whoosh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-27-2015, 09:38 AM
  2. Count Consecutive Days from Today's Date
    By sinspawn56 in forum Excel General
    Replies: 6
    Last Post: 04-24-2015, 06:39 PM
  3. [SOLVED] Formula to count days since, using today function?
    By Johnny247 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-11-2014, 03:27 PM
  4. Replies: 4
    Last Post: 09-12-2013, 11:32 PM
  5. Formula to count number of days in range which are less than today
    By Duke Carey in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 07:05 AM
  6. [SOLVED] Formula to count number of days in range which are less than today
    By zooming in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. [SOLVED] Formula to count number of days in range which are less than today
    By zooming in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

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