Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 287
Default Search a Row and return Header Row Data

I have a spreadsheet with 60 columns of data, each with a unique header
label. What formula do I use to search each row for specific data, then,
upon finding a match, return the header label data (i.e. the info in Row 1 of
that particular column.)

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Search a Row and return Header Row Data

Here is a custom function

call with =GetHeader(10.50,A3:D8,1)
where
10.50 is the data you arre looking for
A3:D8 is range of cells to search
1 is the row of sheet youwant to get data from.

Routine locates the column whre the data is found and then returns the data
in the the same column for the row specified

Function GetHeader(SearchData As Variant, Target As Range, RowNumber)

For Each cell In Target
If SearchData = cell.Value Then Exit For

Next cell

GetHeader = Cells(RowNumber, cell.Column).Value

End Function


"Aaron" wrote:

I have a spreadsheet with 60 columns of data, each with a unique header
label. What formula do I use to search each row for specific data, then,
upon finding a match, return the header label data (i.e. the info in Row 1 of
that particular column.)

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Search a Row and return Header Row Data

With the data to match in A2 and your 60 columns in b:bi

=index($b$1:$bi$1,match(a2,$b2:$bi2,0))



Aaron wrote:

I have a spreadsheet with 60 columns of data, each with a unique header
label. What formula do I use to search each row for specific data, then,
upon finding a match, return the header label data (i.e. the info in Row 1 of
that particular column.)

Thanks!


--

Dave Peterson
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
look up X and return a header Y MMuscat Excel Discussion (Misc queries) 7 November 28th 06 03:50 PM
Search Column Data and Return Multiple Values across Row Sam via OfficeKB.com Excel Worksheet Functions 3 September 30th 06 07:50 PM
Search for a number in a table and return data of a specific cell Karaman Excel Discussion (Misc queries) 4 June 30th 06 03:46 PM
search multiple sheets for specific date, return data in cell to r NonIllegitimiCarborundum Excel Discussion (Misc queries) 0 April 28th 06 09:02 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 11:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"