INDEX/MATCH to find the last cell in a row range that is not zero?

excelos

Active Member
Joined
Sep 25, 2011
Messages
375
Office Version
  1. 365
Platform
  1. Windows
Hello

I have this row 1:
0,0,0,0,2,0,0,0,0,3,0,0

I want to put a formula in the row below (row 2) that will return the first non zero value searching from right to left in the range from $A$1 to [current column, row1]

Any idea?

Thanks!
 

Excel Facts

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

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
48,508
Office Version
  1. 365
Platform
  1. Windows
What Excel version are you using? That will determine what functions are available to use.
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using. (Don’t forget to scroll down & ‘Save’)
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
48,508
Office Version
  1. 365
Platform
  1. Windows
I'm not sure why you are trying to specify what functions to use. Wouldn't any function(s) that get the result do?

What about this (expand beyond column Z if you might have more than 26 columns with numbers)

20 10 22.xlsm
ABCDEFGHIJKLMN
1000020000300
23
Last non-zero
Cell Formulas
RangeFormula
A2A2=LOOKUP(9.9E+307,A1:Z1/(A1:Z1<>0))
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,129,662
Messages
5,637,637
Members
416,977
Latest member
kdoederlein

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
Top