+ Reply to Thread
Results 1 to 8 of 8

Formula for matching a column in excel to two other columns

  1. #1
    Registered User
    Join Date
    03-09-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    2

    Formula for matching a column in excel to two other columns

    In an excel sheet I have three columns.

    Column A includes first names of people in a survey, Column B includes the most popular male names, column C includes the most popular female names.

    I want to see whether the names in column A are male, female, or unknown (based on Column B and C)?

    Also, If a name in column A is for example "James 31" and in column B "James" exists, I want the excel to count "James 31" as "male" and not unknown!

    Thank you in advance!
    Attached Files Attached Files
    Last edited by hmoayyed; 03-09-2017 at 01:59 AM.

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

    Re: Formula for matching a column in excel to two other columns

    Hi, welcome to the forum

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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
    Forum Contributor
    Join Date
    02-14-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    128

    Re: Formula for matching a column in excel to two other columns

    Hi hmoayyed,

    try this in D2 and drag it down. Hope, it works.

    =IF(ISTEXT(VLOOKUP(LEFT(A2,FIND(" ",A2&" ")-1)&"*",$B$2:$B$22,1,0)),"Male",IF(ISTEXT(VLOOKUP(LEFT(A2,FIND(" ",A2&" ")-1)&"*",$C$2:$C$22,1,0)),"female","Unknown"))
    Last edited by Manikandan Arumugam; 03-09-2017 at 04:26 AM. Reason: small error in formula. Rectified
    Manikandan Arumugam
    Excel Learner

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Formula for matching a column in excel to two other columns

    Try

    =IF(ISTEXT(LOOKUP(15^15,SEARCH($B$2:$B$22,A2),$B$2:$B$22)),"Male",IF(ISTEXT(LOOKUP(15^15,SEARCH($C$2:$C$22,A2),$C$2:$C$22)),"Female","unknown"))
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Forum Contributor
    Join Date
    02-14-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    128

    Re: Formula for matching a column in excel to two other columns

    Shukla,

    15^15 wat does this mean. I never used lookup formula. Need ur help to understand this. Thanks in Advance.

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Formula for matching a column in excel to two other columns

    Quote Originally Posted by Manikandan Arumugam View Post
    Shukla,

    15^15 wat does this mean. I never used lookup formula. Need ur help to understand this. Thanks in Advance.
    In my idea, biggest number came with this exponential 15^15=4.37894E+17 and Lookup function is always look nearest biggest value in array and retrieve the results.

  7. #7
    Forum Contributor
    Join Date
    02-14-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    128

    Re: Formula for matching a column in excel to two other columns

    Undrstd. Thank U Shukla.

  8. #8
    Registered User
    Join Date
    03-09-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    2

    Re: Formula for matching a column in excel to two other columns

    Thank you so much to both of you. The formulas are both helpful.

+ 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. matching value of 2 columns in sh1 & sh2 then get value of 3rd column
    By tuongtu3 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-25-2013, 01:39 AM
  2. Excel Formula to find matching row based on multiple columns
    By joshhazel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-17-2013, 01:53 PM
  3. Replies: 7
    Last Post: 02-02-2013, 07:34 AM
  4. Replies: 5
    Last Post: 08-24-2012, 10:59 AM
  5. Replies: 3
    Last Post: 11-24-2011, 09:55 AM
  6. Replies: 3
    Last Post: 06-09-2011, 05:58 AM
  7. Replies: 4
    Last Post: 04-18-2010, 04:50 PM
  8. matching columns to produce new column
    By cls1 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 08-04-2008, 05:54 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