Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Irina
 
Posts: n/a
Default get the last number from the row


Hi guys,

Need piece of advice.

I have to get the last number from the row that is more than 0. Sounds
a little complicated but actually it is for example:

CEll A1 - 10
CEll A2 - 0
CEll A3 - 15
CEll A5 - 0

In Cell A5 I should have 15.

Does somebody have any idea how to get it?

Thanks a lot in advance,

Irina.


--
Irina
------------------------------------------------------------------------
Irina's Profile: http://www.excelforum.com/member.php...fo&userid=8685
View this thread: http://www.excelforum.com/showthread...hreadid=528257

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic
 
Posts: n/a
Default get the last number from the row

Try...

=LOOKUP(2,1/(A1:A40),A1:A4)

Hope this helps!

In article ,
Irina wrote:

Hi guys,

Need piece of advice.

I have to get the last number from the row that is more than 0. Sounds
a little complicated but actually it is for example:

CEll A1 - 10
CEll A2 - 0
CEll A3 - 15
CEll A5 - 0

In Cell A5 I should have 15.

Does somebody have any idea how to get it?

Thanks a lot in advance,

Irina.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Zack Barresse
 
Posts: n/a
Default get the last number from the row

Hi Irina,

Something like this ...

=LOOKUP(2,1/(A1:A50),ROW(A1:A5))

Change the range (A1:A5) to suit.

HTH

--
Regards,
Zack Barresse, aka firefytr
To email, remove NOSPAM


"Irina" wrote in
message ...

Hi guys,

Need piece of advice.

I have to get the last number from the row that is more than 0. Sounds
a little complicated but actually it is for example:

CEll A1 - 10
CEll A2 - 0
CEll A3 - 15
CEll A5 - 0

In Cell A5 I should have 15.

Does somebody have any idea how to get it?

Thanks a lot in advance,

Irina.


--
Irina
------------------------------------------------------------------------
Irina's Profile:
http://www.excelforum.com/member.php...fo&userid=8685
View this thread: http://www.excelforum.com/showthread...hreadid=528257



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Zack Barresse
 
Posts: n/a
Default get the last number from the row

Oops! I gave you one to find the row number. Use this instead...

=LOOKUP(2,1/(A1:A50),A1:A5)

--
Regards,
Zack Barresse, aka firefytr
To email, remove NOSPAM


"Irina" wrote in
message ...

Hi guys,

Need piece of advice.

I have to get the last number from the row that is more than 0. Sounds
a little complicated but actually it is for example:

CEll A1 - 10
CEll A2 - 0
CEll A3 - 15
CEll A5 - 0

In Cell A5 I should have 15.

Does somebody have any idea how to get it?

Thanks a lot in advance,

Irina.


--
Irina
------------------------------------------------------------------------
Irina's Profile:
http://www.excelforum.com/member.php...fo&userid=8685
View this thread: http://www.excelforum.com/showthread...hreadid=528257



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John Michl
 
Posts: n/a
Default get the last number from the row

Irina,
There may be better ways but one would be to create an array formula
such as

{=INDEX(A1:D1,1,MAX(COLUMN(A1:D1)*(A1:D10)))}

Note: Do not enter the braces at the start and end but commit the
formula with Ctrl-Shift-Enter.

Here's how it works:
COLUMN(A1:D1) yields an array of column numbers {1,2,3,4}
(A1:D10) yields an array of TRUE values if greater than zero, else
FALSE {TRUE, FALSE, TRUE, FALSE}
Multiplying the two arrays yields a new array of column numbers and
zeros
{1,2,3,4} * {TRUE, FALSE, TRUE, FALSE} = 1*1, 2*0, 3*1, 4*0 or
{1,0,3,0}
MAX of this yields the column with the highest column number with
non-zero values
INDEX uses that value to pick the value in that column

Note: If your data does not start in column A, you'll need to adjust
the formula a bit since index expects the first value to be in position
1.

Hope that helps.

- John


MAX(COLUMN(A1:D1)*(A1:D10))



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John Michl
 
Posts: n/a
Default get the last number from the row

Clever. I don't understand why it works. Why look up "2" and why does
the array results from 1/(A1:A40) only yield two non-error numbers
even if the data are changed so there's only one zero?

- John

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic
 
Posts: n/a
Default get the last number from the row

Have a look at Aladin's explanation in the following link...

http://www.mrexcel.com/board2/viewto...ys=0&postorder
=asc&start=0

Hope this helps!

In article .com,
"John Michl" wrote:

Clever. I don't understand why it works. Why look up "2" and why does
the array results from 1/(A1:A40) only yield two non-error numbers
even if the data are changed so there's only one zero?

- John

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
Excell-How to add the number of cells containing text? = a sum aruba64taw Excel Worksheet Functions 2 December 21st 05 09:51 AM
Generating (in a random order)each number once from a given number Neil Goldwasser Excel Worksheet Functions 2 December 2nd 05 11:27 PM
Change number format from text to number? Scot New Users to Excel 2 December 1st 05 04:15 PM
vlookup with more than number to be retrieved martelie Excel Worksheet Functions 3 October 14th 05 12:50 PM
Count Number of Characters in a cell? AHJuncti Excel Discussion (Misc queries) 2 June 16th 05 07:39 PM


All times are GMT +1. The time now is 12:15 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"