+ Reply to Thread
Results 1 to 5 of 5

Find matching values and return

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-13-2014
    Location
    Kansas City, Missouri
    MS-Off Ver
    Excel 2013
    Posts
    125

    Find matching values and return

    Hey all - quick question.

    I have two sheets.

    On Sheet S098, I have two colums starting at C2 and D2. And then on S098TOC, I have two columns starting at D4 and G4.

    Basically what I want is kind of simple, but difficult to explain, basically, these are Upstream and Downstream Manholes, and I want a formula that searches S098TOC to see if there are a matching set to what is in S098, and puts a 'C" in a different column on S098.

    So if C2=S098-001 and D2-S098-002, then I want it to search S098TOC for a matching set in the same row.. So for example, if on D25 there was S098-001 and G25 was S098-002, it would put a C on Q2 of S098.

    So basically we're looking for a matching SET, in the same order, between the two sheets.

    Can anyone help? Thanks.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find matching values and return

    Try this...

    =IF(COUNTIFS(S098TOC!D:D,C2,S098TOC!G:G,D2),"C","")

    Copy down as needed.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Contributor
    Join Date
    03-13-2014
    Location
    Kansas City, Missouri
    MS-Off Ver
    Excel 2013
    Posts
    125

    Re: Find matching values and return

    That works, Tony! Thank you so much!

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find matching values and return

    You're welcome. Thanks for the feedback!

  5. #5
    Registered User
    Join Date
    12-17-2014
    Location
    Perth, Australia
    MS-Off Ver
    Windows 7
    Posts
    85

    Re: Find matching values and return

    Sub Macro1()

    a = 2

    Do While Sheets("S098").Cells(a, 3) <> ""

    b = 4
    Do While Sheets("S098TOC").Cells(b, 4) <> ""

    If Sheets("S098").Cells(a, 3) = Sheets("S098TOC").Cells(b, 4) Then
    If Sheets("S098").Cells(a, 4) = Sheets("S098TOC").Cells(b, 7) Then

    Sheets("S098").Cells(a, 17) = "C"

    End If
    End If

    b = b + 1
    Loop

    a = a + 1

    Loop

    End Sub

    Is it looking for matches only in columns D and G or D, E, F and G? Because this macro will not work if it's looking for matches in columns E and F. Hope this helps.

    ***Sorry, just read you wanted formula, not macro***

+ 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. Replies: 3
    Last Post: 01-03-2014, 08:03 PM
  2. Replies: 2
    Last Post: 09-07-2013, 07:50 PM
  3. [SOLVED] Find matching value in a row and return column name
    By suton in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-25-2013, 05:58 PM
  4. [SOLVED] Return cell values for non-matching & matching criteria
    By jenz_skallemose in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-13-2012, 11:52 AM
  5. Find matching value and return text
    By Raoul Duke in forum Excel General
    Replies: 3
    Last Post: 02-14-2008, 01:30 PM

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