Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 186
Default Formula to Return Last Non-Zero Value in Row

Hi,
I'm looking for a formula that will reutrn the last non-zero value in a row.
TIA.
--
Ken Hudson
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Formula to Return Last Non-Zero Value in Row

Based on your question I'm assuming only numbers will involved, no TEXT in
the range?

=LOOKUP(2,1/(1:1<0),1:1)

Will return the last value that is not a zero from row 1, A1:IV1.

Biff

"Ken Hudson" wrote in message
...
Hi,
I'm looking for a formula that will reutrn the last non-zero value in a
row.
TIA.
--
Ken Hudson



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Formula to Return Last Non-Zero Value in Row

Here's a variation of Biff's formula that you can put in A1 (and copy down)
to check the rest of the row..........

=IF(MAX(B1:IV1)0,LOOKUP(2,1/(B1:IV1<0),B1:IV1),"")

Vaya con Dios,
Chuck, CABGx3



"Ken Hudson" wrote:

Hi,
I'm looking for a formula that will reutrn the last non-zero value in a row.
TIA.
--
Ken Hudson

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 186
Default Formula to Return Last Non-Zero Value in Row

Biff,
Thanks for the solution. It works as advertised.
I am trying to undersand the logic.
Is the first "2" Boolean (i.e. "False")?
Is the first "1" Boolean (i.e. "True")?
The formula seems to work whether the "1" is a "1" or a "2."
If you have a moment, could you explain how this works?
(Always trying to improve my Excel logic skills.)
Thanks.

--
Ken Hudson


"Ken Hudson" wrote:

Hi,
I'm looking for a formula that will reutrn the last non-zero value in a row.
TIA.
--
Ken Hudson

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Formula to Return Last Non-Zero Value in Row

See this:

http://xldynamic.com/source/xld.LastValue.html

Scroll (about half way down the page) to this section:

#012 - Using A Non-Array LOOKUP Formula

It explains how the basic formula works.

Biff

"Ken Hudson" wrote in message
...
Biff,
Thanks for the solution. It works as advertised.
I am trying to undersand the logic.
Is the first "2" Boolean (i.e. "False")?
Is the first "1" Boolean (i.e. "True")?
The formula seems to work whether the "1" is a "1" or a "2."
If you have a moment, could you explain how this works?
(Always trying to improve my Excel logic skills.)
Thanks.

--
Ken Hudson


"Ken Hudson" wrote:

Hi,
I'm looking for a formula that will reutrn the last non-zero value in a
row.
TIA.
--
Ken Hudson



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
formula to lookup value and return value from cell at left of target Tony Strazzeri Excel Worksheet Functions 14 October 3rd 06 08:30 AM
Is it possible? DakotaNJ Excel Worksheet Functions 25 September 18th 06 09:30 PM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Excel - return a picture or range rows as the result of a formula juststarting Excel Worksheet Functions 1 July 4th 05 12:59 AM
Formula to return cell contents based on multiple conditions Bill Excel Worksheet Functions 3 January 19th 05 09:59 AM


All times are GMT +1. The time now is 05:22 AM.

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"