ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how to find last value (https://www.excelbanter.com/excel-worksheet-functions/95358-how-find-last-value.html)

adam

how to find last value
 
every day we record the product name, quantity and the date, how to make
lookup or vlookup (or any other function) find the first date and the last
date for specific product to calculate for how many days this product produced
example; we have products a,b and c we record the quantity produced every
day for 30 days (also record the date) the columns ( product / qty / date)
if the product b records only in days 5,6,8,15 and 20 of the month i need
formula to know the the first date is 5 and the last date is 20 the result
should be 15 days
thanks

Biff

how to find last value
 
Hi!

Try this:

Column A = product (A, B, C)
Column C = dates produced

This is an array formula. It MUST be entered using the key combination of
CTRL,SHIFT,ENTER:

This is for product "A":

=MAX(IF(A1:A20="A",C1:C20))-MIN(IF(A1:A20="A",C1:C20))

Adjust ranges to suit.

Biff

"adam" wrote in message
...
every day we record the product name, quantity and the date, how to make
lookup or vlookup (or any other function) find the first date and the last
date for specific product to calculate for how many days this product
produced
example; we have products a,b and c we record the quantity produced every
day for 30 days (also record the date) the columns ( product / qty / date)
if the product b records only in days 5,6,8,15 and 20 of the month i need
formula to know the the first date is 5 and the last date is 20 the result
should be 15 days
thanks




adam

how to find last value
 
Hi
the formula working in the formula screen but the cell always 0

"Biff" wrote:

Hi!

Try this:

Column A = product (A, B, C)
Column C = dates produced

This is an array formula. It MUST be entered using the key combination of
CTRL,SHIFT,ENTER:

This is for product "A":

=MAX(IF(A1:A20="A",C1:C20))-MIN(IF(A1:A20="A",C1:C20))

Adjust ranges to suit.

Biff

"adam" wrote in message
...
every day we record the product name, quantity and the date, how to make
lookup or vlookup (or any other function) find the first date and the last
date for specific product to calculate for how many days this product
produced
example; we have products a,b and c we record the quantity produced every
day for 30 days (also record the date) the columns ( product / qty / date)
if the product b records only in days 5,6,8,15 and 20 of the month i need
formula to know the the first date is 5 and the last date is 20 the result
should be 15 days
thanks





[email protected]

how to find last value
 
Hello,

I suggest

=LOOKUP(2,1/("A"=$A$1:$A$25),$C$1:$C$25)-INDEX($C$1:$C$25,MATCH("A",$A$1:$A$25,))

(no array formula)

Regards,
Bernd


Biff

how to find last value
 
The formula is an array formula. It MUST be entered using the key
combination of CTRL,SHIFT,ENTER. Type the formula, then, instead of just
hitting ENTER like you normally would, hold down both the CTRL key and the
SHIFT key then hit ENTER. If done properly Excel will enclose the formula in
squiggly braces { }. You cannot just type these braces in, you MUST use the
key combo.

Biff

"adam" wrote in message
...
Hi
the formula working in the formula screen but the cell always 0

"Biff" wrote:

Hi!

Try this:

Column A = product (A, B, C)
Column C = dates produced

This is an array formula. It MUST be entered using the key combination of
CTRL,SHIFT,ENTER:

This is for product "A":

=MAX(IF(A1:A20="A",C1:C20))-MIN(IF(A1:A20="A",C1:C20))

Adjust ranges to suit.

Biff

"adam" wrote in message
...
every day we record the product name, quantity and the date, how to
make
lookup or vlookup (or any other function) find the first date and the
last
date for specific product to calculate for how many days this product
produced
example; we have products a,b and c we record the quantity produced
every
day for 30 days (also record the date) the columns ( product / qty /
date)
if the product b records only in days 5,6,8,15 and 20 of the month i
need
formula to know the the first date is 5 and the last date is 20 the
result
should be 15 days
thanks







adam

how to find last value
 
Hi
what is 2,1/ meaning in this formula

" wrote:

Hello,

I suggest

=LOOKUP(2,1/("A"=$A$1:$A$25),$C$1:$C$25)-INDEX($C$1:$C$25,MATCH("A",$A$1:$A$25,))

(no array formula)

Regards,
Bernd



[email protected]

how to find last value
 
Hi Adam,

LOOKUP ignores error values and returns the last non-error value if the
search value was not found.

1/(comparison) gives 1,1,1,#DIV0!,1,1,#DIV0!,1,#DIV0!,1... and if you
search any value 1 in here (i.e. 2) then you will get the position of
the last 1 - exactly what we need. Go into the formula editor and
evaluate this partially by selecting (comparison) and pushing F9, then
1/(comparison) and F9 again, etc.

[Not my invention, just my favourite question if somebody claims to be
an Excel expert :-) ]

Regards,
Bernd



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com