Position of last POSITIVE value in a row

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
Hi, I'm trying to find the location of the last positive value in a row.
Say the data starts in T12 and goes 0,0,0,0,0,2,2,2,2,4,5,6,7,8,0,0,0...
There may be more than one sequence of positive numbers, but no negative numbers. I want to return the position of the LAST positive value in the row

Any ideas please?

Denis
 
HOTPEPPER said:
I've seen formulas like this here before =MATCH(2,1/(T2:T20>0))
and I have tried to figure out how it works, but I don't get this one. Can someone explain how this works.

A) Lookup functions including MATCH() ignore error values.

B) 1 divided by a conditional (like in 1/{TRUE,FALSE,...}) will evaluate to an array of error values and numbers smaller than or equal to 1.

C) 2 is the smallest biggest number for arrays computed by (B).

D) Looking up (with MatchType set to 1/TRUE) a big number in an array or a range will return the last numerical value by binary search [ like in: =LOOKUP(9.99999999999999E+307,Range) ] from that array or range.

Hence, from A to D...

MATCH(2,1/SimpleOrCompositeConditional)


LOOKUP(2,1/SimpleOrCompositeConditional,< Array|Range >)
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Aladin and Fairwinds,

thanks again -- not only for the answer but also for the explanations!

Denis
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,926
Members
449,479
Latest member
nana abanyin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top