# Thread: GET THE LAST VALUE (2000)

1. ## GET THE LAST VALUE (2000)

is possble with a formula to get alaways the last value from a list of value and insert this value in A2?

for example in G2 AAA, in H2 BBB, in I2 CCC

Therefore A2= CCC

2. ## Re: GET THE LAST VALUE (2000)

If your list was in the range G2:Z2 then the following would work.

=INDEX(G2:Z2,1,COUNTA(G2:Z2))

It counts the number of non-blank cells in the range to calculate which is the last cell with a value in it, and the INDEX function displays that value. For it to work all of the "empty" cells must be blank. For instance if they contain a space, the cell may appear blank but it would be counted as non-blank.

3. ## Re: GET THE LAST VALUE (2000)

Alternatively, you could use:
=INDEX(B2:IV2,MATCH(REPT("z",20),B2:IV2))
for a text match - you need a different formula if you're working with values. This formula works regardless of whether the intervening cells are blank, or have numeric values. It could even be simplified to:
=INDEX(2:2,MATCH(REPT("z",20),2:2))
but you'll get circular reference errors if you use this on row 2 and all subsequent cells on that row are empty.

Cheers

4. ## Re: GET THE LAST VALUE (2000)

i m very sorry!

I M SORRY HERE IS THE JUST FILE!

Your correction are refered for the range G2:BN2 of sheet RATE and put the value of last cell active in O2:O20 of sheet ANAGRAFE. I m very sorry!

This modify is valid for every line G2:BN20...

Tks for all.

5. ## Re: GET THE LAST VALUE (2000)

<post#=335840>post 335840</post#>

my dear i have reposted with new attache file.