+ Reply to Thread
Results 1 to 11 of 11

Excel formula if a value matches a value in a range of cells

Hybrid View

  1. #1
    Registered User
    Join Date
    01-03-2024
    Location
    Austin, Texas
    MS-Off Ver
    Office 365
    Posts
    5

    Excel formula if a value matches a value in a range of cells

    Hello,

    I would like to get the following result: if Column A cells exact match Column B cells then in Column D return the corresponding value in Column C.

    Meaning, if origin matches destination, return the location corresponding to destination.

    Screenshot 2024-01-02 231636.png

  2. #2
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Excel formula if a value matches a value in a range of cells

    Test this on D2

    Formula: copy to clipboard
    =IF(A2=B2,C2,"")

  3. #3
    Registered User
    Join Date
    01-03-2024
    Location
    Austin, Texas
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Excel formula if a value matches a value in a range of cells

    This would work if it was row by row 1 to 1 relationship. But Column B values are randomized and not in order so I need Column A to search through all of Column B and copy the corresponding values column c value when there is a match.

  4. #4
    Registered User
    Join Date
    01-03-2024
    Location
    Austin, Texas
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Excel formula if a value matches a value in a range of cells

    Quote Originally Posted by DJunqueira View Post
    Test this on D2

    Formula: copy to clipboard
    =IF(A2=B2,C2,"")
    This would work if it was row by row 1 to 1 relationship. But Column B values are randomized and not in order so I need Column A to search through all of Column B and copy the corresponding values column c value when there is a match.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,923

    Re: Excel formula if a value matches a value in a range of cells

    so A2 matching B10 and result in D2 is C10?

    Formula: copy to clipboard
    =VLOOKUP(A2,$B$2:$C$1000,2),0)
    Last edited by JohnTopley; 01-03-2024 at 03:31 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  6. #6
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,931

    Re: Excel formula if a value matches a value in a range of cells

    Another guess in D2.

    =XLOOKUP(FILTER(A2:A100,A2:A100<>""),B2:B100,C2:C100,"",0)

  7. #7
    Registered User
    Join Date
    01-03-2024
    Location
    Austin, Texas
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Excel formula if a value matches a value in a range of cells

    Quote Originally Posted by windknife View Post
    Another guess in D2.

    =XLOOKUP(FILTER(A2:A100,A2:A100<>""),B2:B100,C2:C100,"",0)
    I tried it but got a #SPILL! error

  8. #8
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,931

    Re: Excel formula if a value matches a value in a range of cells

    You must clean all expected results in column D.

  9. #9
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Excel formula if a value matches a value in a range of cells

    Formula: copy to clipboard
    =xlookup(a2:a11,$b$2:$b$11,$c$2:$c$11,"",0)
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    01-03-2024
    Location
    Austin, Texas
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Excel formula if a value matches a value in a range of cells

    Quote Originally Posted by DJunqueira View Post
    Formula: copy to clipboard
    =xlookup(a2:a11,$b$2:$b$11,$c$2:$c$11,"",0)
    Dear DJunqueira - this worked! Thank you, and really appreciate you taking the time to build out the spreadsheet I should have done. Many blessings!

  11. #11
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Excel formula if a value matches a value in a range of cells

    Thank you for the feedback.

    Have a nice new year.

+ 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: Sum formula that matches multiple criteria to range of cells in column.
    By majesticoj in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-21-2023, 12:05 PM
  2. Replies: 8
    Last Post: 04-10-2023, 05:22 PM
  3. Replies: 3
    Last Post: 04-08-2023, 07:12 PM
  4. Replies: 2
    Last Post: 05-09-2017, 11:15 AM
  5. Replies: 2
    Last Post: 03-19-2014, 03:43 PM
  6. Replies: 9
    Last Post: 07-03-2013, 07:39 AM
  7. Formula to Find If Text In a Cell Matches Another Range of Cells
    By purplesamcat in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-03-2013, 07:45 PM

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