+ Reply to Thread
Results 1 to 6 of 6

Attempting to find duplicate value in a column of cells *backwards*

  1. #1
    Registered User
    Join Date
    02-17-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Attempting to find duplicate value in a column of cells *backwards*

    Hello,

    I am attempting to search a group of cells backwards to find the last duplicate cell in a range. The following is the formula I've currently constructed:

    Please Login or Register  to view this content.
    The above works *almost* perfectly. However, it spits out the first matching row (3) rather than the last (24).


    J3-J48:

    Please Login or Register  to view this content.
    Are there any ideas on how to reverse the search here? Any help would be much appreciated. Thank you!
    Last edited by philsrule91; 02-17-2018 at 06:21 PM. Reason: changed the initial code from a "cell" formula to a "row" formula.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Attempting to find duplicate value in a column of cells *backwards*

    Hi Philsrule,

    Have you tried to do a conditional formatting in Column J showing duplicates? Why do you need the address of the last duplicate instead of scrolling up from the bottom?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Attempting to find duplicate value in a column of cells *backwards*

    Although I'm not sure how this will be useful, this formula will result in the cell address of the last match:

    ="$J$"&LOOKUP(2,1/(J3:J47=J48),ROW(J3:J47))

  4. #4
    Registered User
    Join Date
    02-17-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Re: Attempting to find duplicate value in a column of cells *backwards*

    Quote Originally Posted by MarvinP View Post
    Hi Philsrule,

    Have you tried to do a conditional formatting in Column J showing duplicates? Why do you need the address of the last duplicate instead of scrolling up from the bottom?
    Thanks, Marvin. I have used the conditional formatting to show duplicates on another sheet... unfortunately, it is not something that would help in my particular situation. I'm attempting to create an if/then formula based on the last cell in the column that is identical to the referenced cell.

    The following is the formula that I've come up with thus far:

    Please Login or Register  to view this content.
    (I was able to shrink the "cell" formula into a more compact "row" formula after some trial and error.)

    The above code would be a great starting point for my needs if it spit out row 24 instead of row 3 and would allow me to continue with more "if"s.

    Thanks for the reply!
    Last edited by philsrule91; 02-17-2018 at 05:58 PM.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,636

    Re: Attempting to find duplicate value in a column of cells *backwards*

    Post a sample workbook. The formula in post #4 does not match the sample data in post #1.
    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced next to Quick Post button at the bottom right of the editor box.
    • Scroll down until you see "Manage Attachments",
    • Click the "Choose" button at the upper left (upload from your computer).
    • Select your file, click "open", click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Close the Attachment Manager window.
    • Click "Submit Reply"
    Note: Please do not attach password protected workbooks/worksheets
    Ensure to disable any Workbook Open/Autorun macros before attaching!
    Ben Van Johnson

  6. #6
    Registered User
    Join Date
    02-17-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Re: Attempting to find duplicate value in a column of cells *backwards*

    Quote Originally Posted by 63falcondude View Post
    Although I'm not sure how this will be useful, this formula will result in the cell address of the last match:

    ="$J$"&LOOKUP(2,1/(J3:J47=J48),ROW(J3:J47))
    Thanks for responding, Falcondude. This may have been an error on my part... I was under the assumption that, at least for this purpose, there wouldn't be a difference in using Excel or Google Sheets... after testing, it looks like this formula works in Excel but results in an error (Did not find value '2' in LOOKUP evaluation.) in Google Sheets. My mistake. If anyone has any idea on how to modify the formula to make it work in Sheets, it would be greatly appreciated. If you guys would prefer not to troubleshoot this particular issue as it's Sheets and not Excel, I completely understand and can mark this thread as solved, as the solution for Excel was posted...

+ 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] Need to find if duplicate values exist in a column, concatenate cells and then delete
    By Siemieniuk in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-22-2017, 07:22 PM
  2. [SOLVED] Find if duplicate values exist in a column, concatenate cells and then de
    By filky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2014, 10:14 PM
  3. [SOLVED] Trying to find duplicate cells in a Column
    By syncguy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-31-2013, 04:02 PM
  4. VBA code to find duplicate cells in a column, then perform a function
    By under00c in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-07-2013, 08:19 AM
  5. [SOLVED] Find duplicate cells in column and change value of another cell
    By emm8080 in forum Excel General
    Replies: 6
    Last Post: 05-20-2013, 11:02 AM
  6. Find duplicate text in cells in column, then give names of cells containing duplicate text
    By spelunkerforlife in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2013, 10:13 AM
  7. Replies: 2
    Last Post: 06-26-2010, 06:59 AM
  8. Find last cell in column & average backwards
    By Daytona675 in forum Excel General
    Replies: 13
    Last Post: 08-07-2009, 02:07 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