+ Reply to Thread
Results 1 to 3 of 3

Finding last occurrence and summing up everything above it.

  1. #1
    Registered User
    Join Date
    02-07-2015
    Location
    Ohio, usa
    MS-Off Ver
    ms office 2013
    Posts
    5

    Finding last occurrence and summing up everything above it.

    I have a spread sheet that has customer numbers and total product orders for each customer.
    The sheet is a schedule that has customers reoccurring.

    I want to be able to put in customer 222 and have excel find the last occurrence of that customer and sum up all the orders above that customer so that I may be able to quickly have time frames of completion.

    The sheet would look something like what I have attached. Customer Orders.xlsx
    Last edited by rdperry11; 02-23-2015 at 06:25 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Finding last occurrence and summing up everything above it.

    You can use this array* formula in H3:

    =SUM(INDIRECT("C3:C"&MAX(IF(B$3:B$12=G3,ROW(B$3:B$12)))))

    then copy down.

    * NOTE: an array formula needs to be committed using the key combination of CTRL-SHIFT-ENTER (CSE), rather than the usual <Enter>.

    Hope this helps.

    Pete

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,939

    Re: Finding last occurrence and summing up everything above it.

    H2=SUM($C$3:INDEX($C:$C,MAX(INDEX(($B$3:$B$12=$G3)*ROW($C$3:$C$12),0))))
    Try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

+ 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. Finding second occurrence. HELP!
    By allanpark in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2014, 09:50 PM
  2. Summing up until the next occurrence of text?
    By klin0503 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-03-2014, 03:09 AM
  3. [SOLVED] Finding row number of last occurrence
    By Masquerader1973 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-14-2013, 01:45 PM
  4. [SOLVED] Finding the last occurrence of a value in a list
    By _Josh_ in forum Excel General
    Replies: 9
    Last Post: 11-09-2012, 09:23 PM
  5. Finding Text Occurrence With C#
    By lostintheloop in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2005, 01:00 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