Find first number in a col to the right of a col

T

TroyB

Hi,

I'm having trouble identifying a suitable worksheet function for the
following problem.

I've got a spreadsheet that has over 8 columns and in the 9th column i want
a function that returns the value of the last "non-zero" number entered in
the previous columns.
eg 1
A B C D E F G H I
10 5 2 0 0 0 0 0 2
8 9 3 0 0 0 0 0 3
eg 2
A B C D E F G H I
10 5 2 8 0 0 0 0 8
8 9 3 10 0 0 0 0 10

Col I (where the formula is) provides the number value to the left that has
a "non-zero" number. I am curretnly using a nested "IF" statement which i
believe could be replaced with a more suitable formulae.

Can anyone help? Or what would be a suitable function macro?
Thanks
Troy
 
T

TroyB

How about this for answering my own question:

=OFFSET(C8,,(COUNTIF(C8:N8,">0")-1))

It may not be pretty but its better than nested if's and it works.

Thanks to myself

Troy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top