+ Reply to Thread
Results 1 to 6 of 6

IF AND THEN Formula Multiple Sheets and Entire Column

  1. #1
    Registered User
    Join Date
    06-14-2021
    Location
    NY
    MS-Off Ver
    Google Sheets!
    Posts
    3

    IF AND THEN Formula Multiple Sheets and Entire Column

    I have a multi-page spreadsheet in Google Sheets that I'd like to achieve the following:

    IF the first name in sheet 1, column A, matches the first name in sheet 2, column B

    AND the last name in sheet 1, column B, matches the last name in sheet 2, column A

    THEN matched items should show a '2' in column c on sheet 1 (next to the matched name). If no match, then it should be assigned -.

    Please note that in my data sheet 1 is called Final Credit (TEST SHEET) and sheet 2 is called 'Tech Toolkit -6/10.'

    Here is the formula I'm using: =IF(AND(A:A='Tech Toolkit - 6/10'!B:B,B:B='Tech Toolkit - 6/10'!A:A), "2", "-")

    The problem I'm running into is that the formula is not searching the entire column in sheet 2 for matching names.

    I can't share the sample spreadsheet for reference, so I hope I explained it well enough.

    This is ultimately going to be expanded to dozens of sheets with sheet 1 having columns using whatever code works (hopefully someone can help) pulling from each of the dozens of sheets.

    Perhaps I'm approaching this totally wrong and should be using VLOOKUP? If so, how would I use it here?

    Thank you!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: IF AND THEN Formula Multiple Sheets and Entire Column

    Not too familiar with "sheets", but your formula needs to reference a single cell, not a range - so you are probably using the wrong formula.

    Try something like...
    =IF(ISERROR(MATCH(A2,Sheet2!$B:$B,0)),"",2)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-14-2021
    Location
    NY
    MS-Off Ver
    Google Sheets!
    Posts
    3

    Re: IF AND THEN Formula Multiple Sheets and Entire Column

    Quote Originally Posted by FDibbins View Post
    Not too familiar with "sheets", but your formula needs to reference a single cell, not a range - so you are probably using the wrong formula.

    Try something like...
    =IF(ISERROR(MATCH(A2,Sheet2!$B:$B,0)),"",2)
    Yes! That worked with some minor tweaks with column assignments. Thank you! The code is now:
    =IF(ISERROR(MATCH(A:A,'Tech Toolkit - 6/10'!$C:$C,0)),"",2)

    The thing is, that matches the last name of the participant, but I also need to match the first name in column B of 'Tech Toolkit - 6/10' as we have 450 participants and many have the same last name so I'll need to match the first, too.

    How would I add another match for the second column into the existing formula? Thank you!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: IF AND THEN Formula Multiple Sheets and Entire Column

    1. Note that you need to sue a single cell ref (A2), not a range (A:A) for the 1st criteria in the MATCH function

    2. Perhaps the simplest way would be to add a helper column to combine the 2 names - then use that column in the MATCH formula (obviously combine the 2 names you are searching for, too)
    =IF(ISERROR(MATCH(A2&" "&B2,Sheet2!$J:$J,0)),"",2)
    where column J would contain = A2&" "&B2 copied down

  5. #5
    Registered User
    Join Date
    06-14-2021
    Location
    NY
    MS-Off Ver
    Google Sheets!
    Posts
    3

    Re: IF AND THEN Formula Multiple Sheets and Entire Column

    Quote Originally Posted by FDibbins View Post
    1. Note that you need to sue a single cell ref (A2), not a range (A:A) for the 1st criteria in the MATCH function

    2. Perhaps the simplest way would be to add a helper column to combine the 2 names - then use that column in the MATCH formula (obviously combine the 2 names you are searching for, too)
    =IF(ISERROR(MATCH(A2&" "&B2,Sheet2!$J:$J,0)),"",2)
    where column J would contain = A2&" "&B2 copied down
    Excellent idea. I merged the first and last name columns and used the MATCH formula against that. Worked like a charm. Now if we could only fix people spelling their names correctly in two places! Thanks for your help.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: IF AND THEN Formula Multiple Sheets and Entire Column

    (no need to "reply with quotes" unless you need to refer to a specific reply, just use "reply")

    If you have a comprehensive list of all names, you could use data Validation to make sure the names are correct?

+ 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. If/And formula for multiple conditional data across entire column(s)
    By RadKupE in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-18-2016, 10:37 PM
  2. [SOLVED] Formula to copy row multiple times down entire column
    By Jess0121 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-22-2015, 11:59 AM
  3. Copy and past the entire column from other sheets
    By kkanawata in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-26-2015, 03:04 AM
  4. Run Macro Across Entire Workbook/Multiple Sheets
    By rotediablo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-19-2014, 04:28 PM
  5. Replies: 10
    Last Post: 02-20-2014, 04:09 PM
  6. VBA CODE to Unmerge multiple cells on entire Sheets
    By teachMeExcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-21-2013, 06:03 PM
  7. Concatenate multiple cells with entire column-formula help
    By Onestopfanshop in forum Excel General
    Replies: 6
    Last Post: 06-25-2010, 10:55 AM

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