简体   繁体   中英

Get Multiple Match Values Vertically From a Horizontal Table?

I came across this formula which works well with tables which have data listed vertically, however, I am having difficulty trying to apply this to a horizontal set of data.

I tried changing the ranges etc. without any success and hope someone can help out.

Here's the formula:

{=IF(ISERROR(INDEX($A$1:$B$8,SMALL(IF($A$1:$A$8=$I$5,ROW($A$1:$A$8)),
   ROW(1:1)),2)),"",INDEX($A$1:$B$8,SMALL(IF($A$1:$A$8=$I$5,ROW($A$1:$A$8)),
   ROW(1:1)),2))}

The website where I found this is here:

I would like to get this to work with the

以下示例显示为图像:

Thanks for your help!

Cheers,

Francis

Stands to reason that changing A1:A8 to A1:H1 (rows of data into columns of data) means you also have to change the INDEX range and ROW($A$1:$A$8).

=IFERROR(INDEX($A$1:$H$2, 2, SMALL(IF($A$1:$H$1=$I$5, COLUMN($A:$H)), ROW(1:1))),"")

The newer IFERROR reduces the code and redundant calculation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM