Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need some assistance on creating a "double lookup." Essentially what I am
trying to do is the following: Object: retrieve a number from multiple lists determined by company name and date. Source data would include a company name i.e. company A, B, or C and also the date an order was placed. Those two criteria would need to be used in order to determine the retrieved number. For example, if the order is for company B on 08/28/08. I would need to create a lookup that retrieves a number from list B for that date or later. Any help would be much appreciated. Thank you. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is something I put together if the company name is in A1:A23, the
date is in column B, and the number to retrieve is in column C Option Explicit Sub test() Dim cell As Range Dim Co As String Dim Dte As Date Co = InputBox("Company Name") Dte = InputBox("Date") For Each cell In Range("A1:A23") If cell.Value = Co Then If cell.Offset(0, 1).Value = Dte Then MsgBox cell.Offset(0, 2).Value End If End If Next cell End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Still a little confused here. If anyone else could provide any additional
help, I would greatly appreciate it. Thanks. "GTVT06" wrote: Here is something I put together if the company name is in A1:A23, the date is in column B, and the number to retrieve is in column C Option Explicit Sub test() Dim cell As Range Dim Co As String Dim Dte As Date Co = InputBox("Company Name") Dte = InputBox("Date") For Each cell In Range("A1:A23") If cell.Value = Co Then If cell.Offset(0, 1).Value = Dte Then MsgBox cell.Offset(0, 2).Value End If End If Next cell End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe this:
http://www.contextures.com/xlFunctio...ml#IndexMatch2 The MATCH function can be used to return values for both the row_num and column_num arguments in the INDEX function. Regards, Ryan--- -- RyGuy "Kenton" wrote: Still a little confused here. If anyone else could provide any additional help, I would greatly appreciate it. Thanks. "GTVT06" wrote: Here is something I put together if the company name is in A1:A23, the date is in column B, and the number to retrieve is in column C Option Explicit Sub test() Dim cell As Range Dim Co As String Dim Dte As Date Co = InputBox("Company Name") Dte = InputBox("Date") For Each cell In Range("A1:A23") If cell.Value = Co Then If cell.Offset(0, 1).Value = Dte Then MsgBox cell.Offset(0, 2).Value End If End If Next cell End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you. Thank you. I had to enter some additional information, i.e. fill
in all the dates as I was not doing a lookup but with that one small exception this works perfectly. Thanks again. "ryguy7272" wrote: Maybe this: http://www.contextures.com/xlFunctio...ml#IndexMatch2 The MATCH function can be used to return values for both the row_num and column_num arguments in the INDEX function. Regards, Ryan--- -- RyGuy "Kenton" wrote: Still a little confused here. If anyone else could provide any additional help, I would greatly appreciate it. Thanks. "GTVT06" wrote: Here is something I put together if the company name is in A1:A23, the date is in column B, and the number to retrieve is in column C Option Explicit Sub test() Dim cell As Range Dim Co As String Dim Dte As Date Co = InputBox("Company Name") Dte = InputBox("Date") For Each cell In Range("A1:A23") If cell.Value = Co Then If cell.Offset(0, 1).Value = Dte Then MsgBox cell.Offset(0, 2).Value End If End If Next cell End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Double Lookup | Excel Discussion (Misc queries) | |||
Double Lookup | Excel Worksheet Functions | |||
Variable Lookup/Double Lookup | Excel Worksheet Functions | |||
Double lookup | Excel Programming | |||
Double lookup | Excel Programming |