+ Reply to Thread
Results 1 to 4 of 4

Lookup Table query

  1. #1
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Lookup Table query

    Morning,

    i'm just after a little help, i have a table of data (Sheet "Data") and 2 columns, A= a date range & B= values

    On a separate sheet (Result) i have 2 columns that are also labelled date range and data but with only the date range complete.

    What i want to do is go through each date on the "Result" sheet and copy the associated value from the "Data" table, if the date doesn't exist in the "Data" sheet then i want it to return a zero.

    I'm fairly sure i need a lookup and or match/index formula but i'm not sure of the syntax.

    Can anyone help?

    Thanks,

    Peter

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Lookup Table query

    Welcome to the forum.

    Something like this:

    =IFNA(VLOOKUP(lookup_value,data_range_columns_A_and_B,2,0),0)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Lookup Table query

    Thats great thank you.

    (as it stood it was B and C not A and B that held the info - my bad!)

    It ended up as: =IFNA(VLOOKUP(A2,Data!$B$2:$C$287,2,0),0)

    Could i have used =IFNA(VLOOKUP(A2,Data!B:C,2,0),0) as well?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Lookup Table query

    Yes, but using full column references when not necessary is bad practice, so no!!!

+ 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] Power Query - load to workbook and create query table
    By jaryszek in forum Excel General
    Replies: 1
    Last Post: 12-10-2019, 11:09 AM
  2. [SOLVED] Power Pivot/Query Convert Existing Table to Query
    By trisoldee in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-23-2019, 04:27 PM
  3. Replies: 3
    Last Post: 05-07-2018, 03:41 PM
  4. [SOLVED] Lookup and transfer data from one query to another query
    By roven.aravind in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-14-2017, 06:26 AM
  5. Replies: 0
    Last Post: 12-05-2012, 03:48 PM
  6. Problem with selecting range with in query table after query refresh
    By shooter in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-31-2012, 11:55 AM
  7. Calender table lookup query
    By Graydoggy in forum Excel General
    Replies: 6
    Last Post: 07-09-2009, 09:13 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