Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Creating a double lookup

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Creating a double lookup

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Creating a double lookup

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Creating a double lookup

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Creating a double lookup

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Double Lookup Teddy-B Excel Discussion (Misc queries) 3 October 19th 09 07:06 PM
Double Lookup SteveR Excel Worksheet Functions 6 November 14th 08 11:12 AM
Variable Lookup/Double Lookup Ryan[_2_] Excel Worksheet Functions 8 May 14th 07 09:44 PM
Double lookup MattPrpich Excel Programming 2 November 28th 06 01:35 PM
Double lookup Dean[_8_] Excel Programming 3 July 26th 05 09:25 AM


All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"