Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default vlookup and match first value greater than

I need to lookup a product id and return the date of the first value greater
than zero
For instance

a b c d e f g
1 Date 4/12 4/19 4/26 5/3 5/10 5/17
2 Product A 0 11 35 0 0 125
3 Product B 35 50 75 100 25 36

If I lookup Product A in the spreadsheet and want to get results from
columns e through g I would want to see 5/17 as the result.

I have this formula which works against a fixed row reference but have been
unable to incorporate a lookup value into this to return the same result.
INDEX($e$1:$g$1,MATCH(TRUE,INDEX($e:$g20,0),0))

How do I add to this formula so that I can type a Product ID into a cell and
lookup and return this data from the table? ie. lookup Product A and show the
first date greater than 0.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default vlookup and match first value greater than

One way
Assuming input in say, A7 for the product, eg: Product A
put this in B7, normal ENTER to confirm will do:
=INDEX(OFFSET($E$1:$G$1,MATCH(A7,A2:A3,0),),MATCH( TRUE,INDEX(OFFSET($E$1:$G$1,MATCH(A7,A2:A3,0),)0, ),0))
Success? hit YES below
--
Max
Singapore
---
"MPI Planner" wrote:
I need to lookup a product id and return the date of the first value greater
than zero
For instance

a b c d e f g
1 Date 4/12 4/19 4/26 5/3 5/10 5/17
2 Product A 0 11 35 0 0 125
3 Product B 35 50 75 100 25 36

If I lookup Product A in the spreadsheet and want to get results from
columns e through g I would want to see 5/17 as the result.

I have this formula which works against a fixed row reference but have been
unable to incorporate a lookup value into this to return the same result.
INDEX($e$1:$g$1,MATCH(TRUE,INDEX($e:$g20,0),0))

How do I add to this formula so that I can type a Product ID into a cell and
lookup and return this data from the table? ie. lookup Product A and show the
first date greater than 0.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default vlookup and match first value greater than

Hi,

I do not see the problem with your formula. Your formula yields the answer
as 5/17. The only correction you have to make is that the INDEX function
should be ,
INDEX($e2:$g20,0).

Also, why is the range E2:G2 - why is not B2:G2

--
Regards,

Ashish Mathur
Microsoft Excel MVP

"MPI Planner" wrote in message
...
I need to lookup a product id and return the date of the first value
greater
than zero
For instance

a b c d e f g
1 Date 4/12 4/19 4/26 5/3 5/10 5/17
2 Product A 0 11 35 0 0 125
3 Product B 35 50 75 100 25 36

If I lookup Product A in the spreadsheet and want to get results from
columns e through g I would want to see 5/17 as the result.

I have this formula which works against a fixed row reference but have
been
unable to incorporate a lookup value into this to return the same result.
INDEX($e$1:$g$1,MATCH(TRUE,INDEX($e:$g20,0),0))

How do I add to this formula so that I can type a Product ID into a cell
and
lookup and return this data from the table? ie. lookup Product A and show
the
first date greater than 0.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default vlookup and match first value greater than

Think the earlier can be simplified to just:
=INDEX($E$1:$G$1,MATCH(TRUE,INDEX(OFFSET($E$1:$G$1 ,MATCH(A7,$A$2:$A$3,0),)0,),0))
where A7 = input for the product, as before
--
Max
Singapore
---

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default vlookup and match first value greater than

Assuming your data in A1:G3
Criteria in A7

=MAX(INDEX((A2:A3=A7)*(E2:G30)*E2:G3,))

Normally enter


"MPI Planner" wrote:

I need to lookup a product id and return the date of the first value greater
than zero
For instance

a b c d e f g
1 Date 4/12 4/19 4/26 5/3 5/10 5/17
2 Product A 0 11 35 0 0 125
3 Product B 35 50 75 100 25 36

If I lookup Product A in the spreadsheet and want to get results from
columns e through g I would want to see 5/17 as the result.

I have this formula which works against a fixed row reference but have been
unable to incorporate a lookup value into this to return the same result.
INDEX($e$1:$g$1,MATCH(TRUE,INDEX($e:$g20,0),0))

How do I add to this formula so that I can type a Product ID into a cell and
lookup and return this data from the table? ie. lookup Product A and show the
first date greater than 0.

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
Need greater than = .. less than = combined with index/match state Dingy101 Excel Worksheet Functions 8 December 5th 09 10:38 PM
Vlookup match greater than lookup value papio5949 Excel Worksheet Functions 4 August 20th 07 12:46 AM
How do I get VLOOKUP to look for the next greater value kingcole Excel Discussion (Misc queries) 3 June 13th 06 06:05 PM
vlookup must return a value that is greater than BG Excel Worksheet Functions 3 May 3rd 06 12:09 PM
Vlookup but also equal to and greater than? dazman Excel Worksheet Functions 1 August 7th 05 05:59 PM


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

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

About Us

"It's about Microsoft Excel"