Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Excel – Find All Occurrences of a Specific Value within a Range and Return the Corresponding Value From Row 1

My research has failed me (or perhaps I’m not wording my question properly) on Google and these forums. What I’m trying to do is find all occurrences of -1 from the table in the pic and list out the corresponding values from column A and row 1.

Table

I am currently able to list the values from column A using:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

=IFERROR(INDEX($A$2:$A$8,SMALL(IF($B$2:$G$8=-1,ROW($B$2:$G$8)-1),ROW(1:1))),"")

It returns:

Name

But, I’ve not found any formula that accurately retrieves the value from row 1.

The goal is to have this:

Goal

>Solution :

Just add that to the condition and use COLUMN() for the return and COUNTIF for k.

=IFERROR(INDEX($B$1:$G$1,SMALL(IF(($B$2:$G$8=-1)*($A$2:$A$8=J2),COLUMN($B$2:$G$8)-1),COUNTIF($J$2:J2,J2))),"")

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading