+ Reply to Thread
Results 1 to 5 of 5

Formula to produce data based on column

  1. #1
    Registered User
    Join Date
    02-03-2023
    Location
    United States
    MS-Off Ver
    Microsoft 365 Office
    Posts
    2

    Formula to produce data based on column

    All,

    I am trying to do something that should be simple but I keep getting errors. I believe I should be using VLOOKUP but it is not working.

    I want Excel to look in Sheet2 for the corresponding customer number selected in Sheet1. Then return the City name. Essentially, I have over 700 customers that I need to add city and states to. I have a separate list of all of my 16,000 customers with that information and I need only the 700 desired in sheet one.
    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
    24,705

    Re: Formula to produce data based on column

    I had no problem using this in B5:

    =VLOOKUP(A5,Sheet2!A:C,2,0)

    and this in C5:

    =VLOOKUP(A5,Sheet2!A:C,3,0)

    I suspect that you omitted the ,0 from the end, which means to look for an exact match. If you want to avoid the #N/A error when there is not an exact match, you can use this:

    =IFERROR(VLOOKUP(A5,Sheet2!A:C,2,0),"")

    and the same for the other formula.

    Hope this helps.

    Pete
    Last edited by Pete_UK; 02-03-2023 at 02:33 PM. Reason: Corrected the cell reference where formula should go

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,705

    Re: Formula to produce data based on column

    I've just noticed that some of your data in Sheet2 has no State, and some have no city. In cases like this you will see zero on Sheet1. You can avoid this by doing the following:

    B5: =IFERROR(VLOOKUP(A5,Sheet2!A:C,2,0)&"","")

    C5: =IFERROR(VLOOKUP(A5,Sheet2!A:C,3,0)&"","")

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    02-03-2023
    Location
    United States
    MS-Off Ver
    Microsoft 365 Office
    Posts
    2

    Re: Formula to produce data based on column

    Pete,

    Thank you very much for that. It is finally working. I appreciate the quick help, wish I knew this forum was here a long time ago

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,705

    Re: Formula to produce data based on column

    Glad to help, and thanks for marking the thread as Solved. I think the Forum started in 2003, so it has been around for a while.

    Since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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] Formula to produce one figure based on two columns of text and one of numbers.
    By Kerry1980 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-14-2022, 09:58 AM
  2. [SOLVED] Sum up some numbers based on column criteria to produce an output
    By spenctr01 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-27-2021, 03:27 AM
  3. [SOLVED] Formula to produce result based on dropdowns and VLOOKUP
    By kyle4570 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-10-2021, 05:45 PM
  4. Formula to produce list based on data table
    By BillDoor in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-17-2015, 05:27 AM
  5. How to produce a list based on multiple row and column variables
    By beiag001 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-25-2015, 06:42 AM
  6. Replies: 4
    Last Post: 02-21-2013, 05:35 PM
  7. [SOLVED] Formula to produce list of data based on criteria
    By samcdavies in forum Excel General
    Replies: 7
    Last Post: 06-23-2012, 10:22 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