Formula to return column header

X

XP

Using Office 2007 with Windows XP;

I need a formula that can look across several columns and return the value
of the header row for the column that does not contain a zero value.

For example (hopefully this will line up):

A F G H
R1 MISC1 MISC2 MISC3

R3 {formula} 0 25.25 0

If the example above, the formula in A3 should return: MISC2
Since that is the column heading for the column that doesn't have
a zero balance.

I hope this makes sense. Thanks much for your assistance.
 
M

Mike H

Hi,

If you saying only one of these columns will have a value then this will do it

=LOOKUP(2,1/(F2:I2<>0),F1:I1)

If there is more than one column with a value it will return the last.

Mike
 
X

XP

Works exactly as I needed! Thanks!

Mike H said:
Hi,

If you saying only one of these columns will have a value then this will do it

=LOOKUP(2,1/(F2:I2<>0),F1:I1)

If there is more than one column with a value it will return the last.

Mike
 

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