Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Formula to return column header

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Formula to return column header

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

"XP" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Formula to return column header


Works exactly as I needed! Thanks!

"Mike H" wrote:

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

"XP" wrote:

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.

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
Return column header based on last value in row C. Excel Worksheet Functions 3 April 12th 10 08:53 AM
Return column header Huber57 Excel Discussion (Misc queries) 3 January 14th 10 04:03 PM
How to return a Column Header Scott Excel Discussion (Misc queries) 1 June 18th 09 10:22 PM
Return column number from column header text Roger[_3_] Excel Discussion (Misc queries) 4 February 14th 08 09:40 PM
Return Column header, if row value is > X kvail Excel Discussion (Misc queries) 2 January 11th 05 01:31 PM


All times are GMT +1. The time now is 10:53 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"