+ Reply to Thread
Results 1 to 8 of 8

Match cells in 2 columns and return third column value if equal

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Match cells in 2 columns and return third column value if equal

    I have 2 sheets with thousands of clients. One has client contact information and one revenue. I was able to put the 4 columns on 1 sheet. I need a formula that will say if the value of the client name columns match, (Client name) then return the value in the third column (revenue).

    One other question, b/c i copied from a pivot table, i have the client name and their email address below in a separate row. Ideally i would have the client their contact and their revenue in 3 columns next to each other. Is there an easy way to bulk move the email address from the row below the column to the column next to the client name?

    Thanks!
    Attached Files Attached Files

  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,440

    Re: Match cells in 2 columns and return third column value if equal

    Put the following formulae in the cells stated:

    L1: =IF(INDEX(A:A,(ROWS($1:1)-1)*3+1)="","",INDEX(A:A,(ROWS($1:1)-1)*3+1))

    M1: =IF(L1="","",INDEX(A:A,(ROWS($1:1)-1)*3+2))

    N1: =IFERROR(VLOOKUP(L1,$G$1:$I$8,3,0),"")

    then copy the formulae down as far as you need to (until you get blanks).

    Hope this helps.

    Pete

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,158

    Re: Match cells in 2 columns and return third column value if equal

    if the information is formated as the example
    then in B1 put

    =IF(OR(A2="",ISERROR(FIND("@",A2,1))),"",A2)

    that will copy up the email address next to the client
    you can then always add another code and sort - using the find() to then insert a code to filter or sort and remove the email rows

    then you can use vlookup or index/match to get the revenue

    =IFERROR(VLOOKUP(A1,$G$1:$J$9,3,FALSE),"")

    in fact you could use the iferror

    so
    =IFERROR(VLOOKUP(A1,$G$1:$J$9,3,FALSE),"ZZZZZZ")

    now sort - all the ZZZZ will be together and then you can delete
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Match cells in 2 columns and return third column value if equal

    Thanks this worked very well thanks. Im kind of new though how do i use find() to remove the old email addresses for A column?

    Quote Originally Posted by etaf View Post
    if the information is formated as the example
    then in B1 put

    =IF(OR(A2="",ISERROR(FIND("@",A2,1))),"",A2)

    that will copy up the email address next to the client
    you can then always add another code and sort - using the find() to then insert a code to filter or sort and remove the email rows

    then you can use vlookup or index/match to get the revenue

    =IFERROR(VLOOKUP(A1,$G$1:$J$9,3,FALSE),"")

    in fact you could use the iferror

    so
    =IFERROR(VLOOKUP(A1,$G$1:$J$9,3,FALSE),"ZZZZZZ")

    now sort - all the ZZZZ will be together and then you can delete

  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,158

    Re: Match cells in 2 columns and return third column value if equal

    i would use the iferror section and then sort or filter on that revenue column

    =IFERROR(VLOOKUP(A1,$G$1:$J$9,3,FALSE),"ZZZZZZ")

    or use
    Pete_UK solution

    the i would select columns L,M,N
    and copy
    paste special > value

    now you can delete the other columns , and have a clean set of columns

  6. #6
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Match cells in 2 columns and return third column value if equal

    Thing is not every client will have revenue. Some didnt do anything so they would show up as a blank but i still need them listed on the sheet with their email address to the right.

    Quote Originally Posted by etaf View Post
    i would use the iferror section and then sort or filter on that revenue column

    =IFERROR(VLOOKUP(A1,$G$1:$J$9,3,FALSE),"ZZZZZZ")

    or use
    Pete_UK solution

    the i would select columns L,M,N
    and copy
    paste special > value

    now you can delete the other columns , and have a clean set of columns

  7. #7
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Match cells in 2 columns and return third column value if equal

    Nevermind. I filtered out anything that contained @ and deleted. Thanks for everyones help!

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,158

    Re: Match cells in 2 columns and return third column value if equal

    does that mean the client will not be listed in the table or in the table but with zero as the revenue ?

+ 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: 9
    Last Post: 12-16-2013, 04:02 AM
  2. Replies: 20
    Last Post: 04-15-2013, 01:06 PM
  3. Replies: 3
    Last Post: 05-24-2012, 10:10 AM
  4. Match 2 columns in 2 sheets and return the 3rd column
    By swadson in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-16-2011, 04:36 PM
  5. Replies: 6
    Last Post: 03-01-2011, 06:23 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