+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP using two parameters

  1. #1
    Registered User
    Join Date
    11-03-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    2

    VLOOKUP using two parameters

    This seems simple enough, but it's causing me a lot of grief!

    I have two spreadsheets with weather type data:

    The first has the following columns "Station" and "Date". This sheet has random days over a few years.

    The second has three columns "Station" "Date" "Visibility". This sheet has every single day over the last few years.

    What I need to do is extract the visibility value from the second worksheet based on the station and date of the first sheet. So, for example, I have Station "Alpha" on 20040501. I need to search based on those parameters in the second sheet and pull the visibility value for that day. This needs to be automatic because the actual file I have contains about 7000 records so it would take forever to do manually! See attached sample file

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    10-17-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013, 2016, 2019, 365
    Posts
    294

    Re: VLOOKUP using two parameters

    You could combine the two into a single unique value on each sheet, then use that for VLOOKUP. In attached example, I've used
    =A2&"-"&TEXT(B2,"YYYYMMDD")
    This concatenates Station, a hyphen and the date reformatted correctly. Do that on both, and then VLOOKUP
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    02-08-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: VLOOKUP using two parameters

    Since you are using Excel 2007 and the desire result is numerical & unique.

    =SUMIFS(Weather!$C$2:$C$63,Weather!$A$2:$A$63,A2,Weather!$B$2:$B$63,B2)

    Regards

  4. #4
    Registered User
    Join Date
    11-03-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: VLOOKUP using two parameters

    Quote Originally Posted by outofthehat View Post
    You could combine the two into a single unique value on each sheet, then use that for VLOOKUP. In attached example, I've used
    =A2&"-"&TEXT(B2,"YYYYMMDD")
    This concatenates Station, a hyphen and the date reformatted correctly. Do that on both, and then VLOOKUP
    Wow, it was simple enough! Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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