+ Reply to Thread
Results 1 to 4 of 4

Searching data in two columns and returning data from a third column

  1. #1
    Registered User
    Join Date
    10-26-2012
    Location
    Williamsburg, VA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Searching data in two columns and returning data from a third column

    Hello;
    Based on the example below, I want to search column A for a particular value, then search column C for either 1,2, or 3, and retrieve the corresponding value in that row from column B. Am I correct in thinking to nest IF and AND functions? If so, I am doing something wrong syntax-wise. Any help would be appreciated.

    Thanks,
    Dave

    A B C
    BOSTON111 111-1-2 1
    BOSTON111 111-2-2 2
    BOSTON111 111-3-2 3
    CHICAGO222 222-1-2 1
    CHICAGO222 222-2-2 2
    CHICAGO222 222-3-2 3
    ATLANTA333 333-1-2 1
    ATLANTA333 333-2-2 2
    ATLANTA333
    Last edited by d dubya; 02-12-2014 at 05:00 PM. Reason: Solved

  2. #2
    Registered User
    Join Date
    10-26-2012
    Location
    Williamsburg, VA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Searching data in two columns and returning data from a third column

    My columns didn't paste like I wanted them to- Column A contains the city, columns B contains 3 numbers separated by dashes, column C contains 1,2, or 3. Sorry.

  3. #3
    Registered User
    Join Date
    01-27-2014
    Location
    DFW, Texas
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Searching data in two columns and returning data from a third column

    You might need a helper column that you can hide. try entering =A2&C2 in column D, which should give you "Boston1", then fill down the length of your data and hide the column (just to make it pretty)

    then in your formula cell write =index(B:B,Match(city&#,D:D,0)) where "city" = the cell you are typing the city you want to look up and "#" = the cell containing the number you want from the city.

    I havent yet discovered a good way to do a countifs for finding multiple criteria in differnet columns.

  4. #4
    Registered User
    Join Date
    10-26-2012
    Location
    Williamsburg, VA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Searching data in two columns and returning data from a third column

    Thanks, qikslvr. Being a minimalist, I sometimes overlook adding helper columns.
    I appreciate your help.

    Dave

+ 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] Searching through a column of items that has data and returning the data name.
    By Syntax in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-21-2013, 11:35 PM
  2. Returning Data from 3rd Column When 2 columns match
    By stephR82 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-02-2012, 07:58 AM
  3. Searching arrays and returning column and row heading data
    By andywilson in forum Excel General
    Replies: 7
    Last Post: 01-10-2012, 06:25 AM
  4. Replies: 5
    Last Post: 05-04-2011, 06:51 PM
  5. Sorting/Searching & returning data
    By pog_g in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2005, 04:05 AM

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