+ Reply to Thread
Results 1 to 7 of 7

Formula for finding last incident?

  1. #1
    Registered User
    Join Date
    09-25-2011
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    4

    Formula for finding last incident?

    Hey!
    I want to find a formula that do the trick to find the last incident of a value or text. Lets say we have five different salers, and want a column where the last value or text is shown.

    So the formula should search in the column "SALER" and the last date with this saler and show the result in a cell.

    I have made a sheet where I try to show you the problem. In the "LAST SALE" column the value of last sale for the saler should be. And the search for it should be based on the names and dates in column A and B.

    Hope you understand the problem.

    Thanks in advance!
    Anthony Moody
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Formula for finding last incident?

    I think a code should do this for u. But in what format do you need the output?

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Formula for finding last incident?

    AnthonyMoody,

    Attached is a modified version of your example workbook. In cell D2 it contains the following array formula:
    =SUMPRODUCT(--($B$2:$B$204=B2),--($A$2:$A$204=MAX(IF($B$2:$B$204=B2,$A$2:$A$204,0))),$C$2:$C$204)

    And then its just copied down.

    An array formula needs to be entered with Ctrl+Shift+Enter and not just enter. Ctrl+Shift+Enter will need to be used if formula is altered as well.

    Hope that helps,
    ~tigeravatar
    Attached Files Attached Files

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: Formula for finding last incident?

    Try this:

    =LOOKUP(2, 1/(B:B=B2), C:C)
    Never use Merged Cells in Excel

  5. #5
    Registered User
    Join Date
    09-25-2011
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Formula for finding last incident?

    okey! maybe I did not explain good enough.... What I want is that a formula is searching for the salers last sale value.... based on the salers name and the date of the sale...


    I want to find the last date of sale value based on the saler!

    I working with this formulas at the time...
    INDEX
    MATCH
    LARGE or MAX?
    IF

    I wonder how I can make this a formula.. in cell C14 =INDEX($c2$:$c13(IF(MATCH($b14;$b$2:$b13;0);LARGE($a$2:$a13;1)

    Hope this cleared it a little bit!

  6. #6
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,310

    Re: Formula for finding last incident?

    Have you tried using a Pivot Table? (See attached)
    Attached Files Attached Files

  7. #7
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,310

    Re: Formula for finding last incident?

    Here's the array formula (Ctlr+Shft+Enter) used in the attached file.

    =INDEX($A$2:$A$204,LARGE(IF($B$2:$B$204=$E2,ROW($A$2:$A$204)-ROW($A$2)+1),1))
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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