View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ashish Mathur[_2_] Ashish Mathur[_2_] is offline
external usenet poster
 
Posts: 1,766
Default Last value in column before blank

Hi,

Assume data in in range C4:C18. The inherent assumption in this formula is
that the last digit of the product code increments by 1. Try this

=MAX(INDEX($C$4:$C$18,MATCH(F20,$C$4:$C$18,0)+1,1) :INDEX($C$4:$C$18,IF(ISERROR(MATCH(LEFT(F20,3)&RIG HT(F20,1)+1,$C$4:$C$18,0)-1),ROWS($C$4:$C$18),MATCH(LEFT(F20,3)&RIGHT(F20,1) +1,$C$4:$C$18,0)-1),1))

F20 has is the user entry cell for the the product code I.e. V100, V101 etc.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"craig" wrote in message
...
Hi, My data in one column A:A - Where V100 &V101 are product codes, dates
run
down the column and Blank is a blank cell befor each new product code.
V100
1-Sep-09
2-Sep-09
Blank
V101
1-Oct-09
5-Oct-09
10-Oct-09
Blank

Question is how do i return the date value for the last entry (eg before
the
blank) for each product code I want to find. Note also the last date entry
is
always the max value date. Eg V100 = 2-Sep and V101 =10-Oct.
Thks Craig