+ Reply to Thread
Results 1 to 5 of 5

return date when current value most recently occured

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    perth, australia
    MS-Off Ver
    Excel 2011
    Posts
    22

    return date when current value most recently occured

    Hey guys,

    I've been trying to figure this one out to no avail. I have a spreadsheet with sports results. I want column E to calculate number of days that have elapsed since the home teams last match. I'm stuck because the current home team may have played away in their last game, but maybe not. So they will have appeared in either column b or c.

    Data in spreadsheet as follow
    column A: date
    b: home team name
    c: away team name
    d: result (1= home win)
    e: the problem column

    I've attached a simplified version of the spreadsheet. Any help would be mightily appreciated.

    lastdate.xlsx

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: return date when current value most recently occured

    Hi wishkey,

    Which one is home team here out of a/b/c/d?
    Also, can you mention what result you are looking for in column E and I'll try to obtain them using formulas ? Thanks.

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    04-25-2013
    Location
    perth, australia
    MS-Off Ver
    Excel 2011
    Posts
    22

    Re: return date when current value most recently occured

    So in row 16, d is the home team and b is the away team. therefore the value in E16 should be 12, since twelve days have elapsed since the home team's (d) last match, which was on may 12.

    For row E15, the value would also be 12, since twelve days have elapsed since c's last match. I tried using a vlookup function, but couldn't get the result i wanted

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: return date when current value most recently occured

    I would be tempted to use two helper columns, one for the date of the previous home date, the other for the last away date, then use a simple IF() statement to calculate the elapsed dates.

    Note that the formulae in G2, H2 and the substituted formula in M2 are all CSE arrays, and must be individually confirmed with Ctrl+Shift+Enter, not just Enter, before dragging Down.

    Doubtless column M could be simplified, but I would rather use the helpers to keep things a tad simpler to maintain.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  5. #5
    Registered User
    Join Date
    04-25-2013
    Location
    perth, australia
    MS-Off Ver
    Excel 2011
    Posts
    22

    Re: return date when current value most recently occured

    Outstanding

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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