简体   繁体   中英

Returning multiple string values using index,match on multiple criteria

I have a google form populating an ever-growing spreadsheet from which I would like to generate an overview sheet as a daily report.

Here is an excerpt from "Form Responses 1"

https://pasteboard.co/I74RboO.png

I am successfully using an index/match (matching on both the property name (col C) and yesterday's date (col F)) to return a string value (Col H) but I am struggling to return more than one instance of a match EG: rows 416 / 417.

As the result is a string, all the tutorials I can find (which use small()) don't appear to work. I am relatively new to excel so may be missing something.

everything I have tried which is mainly small() give me a #num! error so I am guessing that small is the wrong way to go, but cannot google up an alternative.

Formula I am trying is

Formula in E4:

{=INDEX('Form Responses 1'!$H:$H,SMALL(MATCH(1,($E$3='Form Responses 1'!$F:$F)*($B$4='Form Responses 1'!$C:$C),0),ROW(1:1)))}

Formula in E5:

{=INDEX('Form Responses 1'!$H:$H,SMALL(MATCH(1,($E$3='Form Responses 1'!$F:$F)*($B$4='Form Responses 1'!$C:$C),0),ROW(2:2)))}

Which works on the first instance (row 4) but not row 5:

https://pasteboard.co/I74WbYE.png

There may be up to 5 or so rows for the 2 matches (historically) so I need to be able to present these in a readable form. Currently I am using excel but will need to port to google forms and post out automatically on the daily.

Any help gratefully received.

Here is an example for you to try out in a simplified way

      A     B        C            D        E       F          G
1     CH    Red      999
2     DE    Red      654'321                       Blue
3     FR    Green    43'213                        DE
4     CH    Green    74'123
5     DE    Green    4'651                 1       6'541      645'132
6     SA    Blue     6'541                 2       3'120      135'561
7     CH    Blue     3'120                 3       645'132    #NUM!
8     DE    Blue     645'132               4       148'085    #NUM!
9     CH    Red      179'395               5       141'823    #NUM!
10    DE    Red      173'133               6       135'561    #NUM!
11    SA    Green    166'871                
12    CH    Green    160'609
13    DE    Green    154'347
14    SO    Blue     148'085
15    CH    Blue     141'823
16    DE    Blue     135'561

.

Column F: Single criteria : Only "Blue" --> 6 occurences

in F5 I have

=INDEX($C$1:$C$18,SMALL(IF($B$1:$B$18=$F$2,ROW($B$1:$B$18)-ROW(INDEX($B$1:$B$18,1,1))+1),E5))

Column G: Multiple cliteria: "Blue" & "DE" --> 2 occurences

in G5 I have

=INDEX($C$1:$C$18,SMALL(IF($B$1:$B$18=$F$2,IF($A$1:$A$18=$F$3, ROW($A$1:$A$18)-ROW(INDEX($A$1:$A$18,1,1))+1)),E5))`

Careful: those are array formulas -> press Ctrl + Shift + Enter when inputting the formula

in this example, the Nth value is defined by the 1-6 numbers in column E

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