+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : Enter a value in a cell to signify the last occurence of the same value (see detail!)

  1. #1
    Registered User
    Join Date
    03-22-2012
    Location
    Wolverhampton, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Enter a value in a cell to signify the last occurence of the same value (see detail!)

    I have a table in Excel as follows:

    Event Part_Number Process Stock_Position
    10598 ADF345 Picked
    10599 ADF345 Assembled
    10599 ADF345 Inspection
    10600 ADF345 Packed
    10600 EFT689 Picked
    10601 EFT689 Assembled
    10601 DBM165 Picked
    10602 DBM165 Assembled
    10602 WTP726 Picked
    10603 WTP726 Assembled
    10603 WTP726 Rejected


    In each cell under stock position I want to write a formula to enter the process associated with the highest event code for each part number. For example for ADF345 'Packed' would appear under stock position.

    Any ideas?

    Thanks

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

    Re: Enter a value in a cell to signify the last occurence of the same value (see detail!)

    Hi Twi78,

    Welcome to the forum.

    Use the below formula in cell D2 and drag it down:-

    {=OFFSET($C$1,MAX(IF(($B$2:$B$12=$B2),ROW($A$2:$A$12)-1,"")),0)}

    Note:- Above is an array formula and need to be entered using Ctrl+ Shift+ Enter key combination. Thanks.


    regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    03-22-2012
    Location
    Wolverhampton, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Enter a value in a cell to signify the last occurence of the same value (see detail!)

    Excellent!
    Thanks for the quick reply.

  4. #4
    Registered User
    Join Date
    03-22-2012
    Location
    Wolverhampton, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Enter a value in a cell to signify the last occurence of the same value (see detail!)

    I have now added an extra column to include a date, so now I want to write a formula to enter the process associated with the highest event code for each month and part number:

    Event Part_Number Date Process Stock_Position
    10598 ADF345 15/01/2012 Picked
    10599 ADF345 29/01/2012 Assembled
    10599 ADF345 15/02/2012 Inspection
    10600 ADF345 29/02/2012 Packed Packed
    10600 EFT689 15/02/2012 Picked
    10601 EFT689 29/02/2012 Assembled Assembled
    10601 DBM165 15/02/2012 Picked
    10602 DBM165 29/02/2012 Assembled Assembled
    10602 WTP726 29/01/2012 Picked
    10603 WTP726 15/02/2012 Assembled
    10603 WTP726 29/02/2012 Rejected Rejected

    Therefore I would expect to see a stock position on event 10599 & 10603 also.

    The formula I am using is: {=IF(OFFSET($D$1,MAX(IF(($B$2:$B$12=$B2),ROW($A$2:$A$12)-1,"")),0)=D2,D2,"")}

    Thanks

  5. #5
    Registered User
    Join Date
    03-22-2012
    Location
    Wolverhampton, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Enter a value in a cell to signify the last occurence of the same value (see detail!)

    Actually managed to solve it using the formula you suggested just slightly modified:

    =IF(OFFSET($D$1,MAX(IF(($B$2:$B$12&MONTH($C$2:$C$12)=$B3&MONTH($C3)),ROW($A$2:$A$12)-1,"")),0)=D3,D3,"")

    Thanks

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

    Re: Enter a value in a cell to signify the last occurence of the same value (see detail!)

    you are welcome...

    cheers

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ 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