Solved

Index and Match optimization

Posted on 2014-02-26
2
353 Views
Last Modified: 2014-02-27
Following formula only find he first occurrence of value 10 and returns the column header in row 1 .. how can I make it to find all occurrence of value 10 in the row and output corresponding column header in row 1?

=INDEX($B$1:$G$1,MATCH(10,INDEX($B$2:$G$7,MATCH("Row 3",$A$2:$A$7,0),0),0))
0
Comment
Question by:CalmSoul
  • 2
2 Comments
 
LVL 81

Expert Comment

by:byundt
ID: 39890888
Here is an array-entered formula you might use:
=IFERROR(INDEX($B$1:$G$1,SMALL(IF(INDEX($B$2:$G$7,MATCH("Row 3",$A$2:$A$7,0),0)=10,COLUMN($B$2:$G$7)-COLUMN($B$2)+1,""),COLUMNS($B1:B1))),"")

To array-enter a formula:
1.  Select the cell, then click in the formula bar
2.  Hold the Control and Shift keys down
3.  Hit Enter, then release all three keys
Excel should respond by adding curly braces { } surrounding the formula.

The formula will return an empty string (looks like  blank) if you don't array-enter it successfully. If so, repeat the steps.

The formula is designed to be copied across and return successive header labels until there are no more cells containing 10 in "Row 3". When the list is exhausted, the formula returns an empty string.
0
 
LVL 81

Accepted Solution

by:
byundt earned 500 total points
ID: 39890893
Sample file with array-entered formula
ColumnHeadersWith10-Q28375537.xlsx
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script checks a path to see if a folder exists. If the folder does exist you will get output "The folder has previously been created. No action taken" If not it will create the folder. Then adds one user modify permission to the folder. It …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now