+ Reply to Thread
Results 1 to 6 of 6

Selecting cells to sum based on LAST occurring incidence of criteria

Hybrid View

Excel enthusiast Selecting cells to sum based... 07-11-2021, 09:32 AM
Glenn Kennedy Re: Selecting cells to sum... 07-11-2021, 09:43 AM
Excel enthusiast Re: Selecting cells to sum... 07-11-2021, 10:17 AM
Glenn Kennedy Re: Selecting cells to sum... 07-11-2021, 10:20 AM
Excel enthusiast Re: Selecting cells to sum... 07-11-2021, 10:22 AM
Glenn Kennedy Re: Selecting cells to sum... 07-11-2021, 10:57 AM
  1. #1
    Registered User
    Join Date
    05-19-2019
    Location
    Sunderland
    MS-Off Ver
    365
    Posts
    8

    Smile Selecting cells to sum based on LAST occurring incidence of criteria

    Hi Excel forum,
    I hope your amazing members can help me with a function issue I have.

    I need to create a formula that counts based on multiple criteria - a simple COUNTIFS you might think. But alas this is not satisfying the needs.
    The function must select the LAST occurring incidence of criteria and sum that.
    E.g. data is categorised as:
    Person number ( person 1, person 2 etc), date, status (Start, Include, End, and can have several occurrences of Start and end over time with several Includes within each group), value to be summed.

    What I need a formula for is to search for the LAST occurring START and count everything from there to the current cell's timepoint, or to the last "END" status prior to this cell's date.
    It is likely that there will be varying numbers of records between each "START" and "END" status. I need a formula that can dynamically identify only the last "START" and commence counting from there to the current position for the selected person in that row.

    Not sure I've explained this accurately enough, so I have mocked up a simple spreadsheet - see attached.
    I hope this demonstrates my requirements.

    Is there a formula that could generate the required results?

    Thanks in advance
    Attached Files Attached Files

  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 2406
    Posts
    44,662

    Re: Selecting cells to sum based on LAST occurring incidence of criteria

    Maybe this:

    =IF(Table13[@Status]="","",IF(Table13[@Status]="Start",1,I3+1))
    Attached Files Attached Files
    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

  3. #3
    Registered User
    Join Date
    05-19-2019
    Location
    Sunderland
    MS-Off Ver
    365
    Posts
    8

    Re: Selecting cells to sum based on LAST occurring incidence of criteria

    Hi Glen,

    Thanks for your very quick reply, and solution.
    It's so simple. Why didn't I think of this???

    It's definitely a "Doh!" moment from me.

    (When using this in my actual spreadsheet, I'll have to ensure the dataset provided to me is sorted by both person and date ascending order otherwise the formula isn't accurate.)

    Thanks again.
    Best wishes,
    Karen

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

    Re: Selecting cells to sum based on LAST occurring incidence of criteria

    If you had O365, you could build that in easily enough, but...

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    05-19-2019
    Location
    Sunderland
    MS-Off Ver
    365
    Posts
    8

    Re: Selecting cells to sum based on LAST occurring incidence of criteria

    I have 365 at home (just changed my profile now )but sadly not at work, where I'll need to use it.

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

    Re: Selecting cells to sum based on LAST occurring incidence of criteria

    ok... But, if you need to ask a work Q again, don't forget to specify that it needs to work in Excel 2010....

+ 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] Formula to return the most commonly occurring (text) value based on criteria
    By Excel_NoneTheWiser in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 04-23-2021, 01:02 PM
  2. Selecting cells in one column based on criteria in another
    By CDandVinyl in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-15-2017, 03:29 PM
  3. Selecting random cells based on criteria
    By JamesTrethowan in forum Excel General
    Replies: 8
    Last Post: 10-28-2015, 11:15 AM
  4. Replies: 7
    Last Post: 01-14-2015, 11:38 PM
  5. Using Avergeifs and selecting last 8 cells based on criteria
    By boyesmar in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-29-2013, 09:53 AM
  6. Using Avergeifs and selecting last 8 cells based on criteria
    By boyesmar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-23-2013, 09:20 PM
  7. Selecting Range of Cells based on Criteria
    By gmclauchlan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2011, 12:19 PM

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