Excel: How to use an Array to concatenate strings that are next to a criteread section (If function)

后端 未结 3 1697
旧时难觅i
旧时难觅i 2021-01-17 03:51

Good Day Everyone

I have an Excel sheet as bellow in two columns. I know how to use an array if function with sum to add up all values next to a column that has met

3条回答
  •  遇见更好的自我
    2021-01-17 04:19

    If I'm assuming you don't want the relatively easy VBA solution where you recurse through the initial list and concatenate the answers then you could put the following into B8:

    =IFERROR(INDEX(Sheet1!$A$1:$A$6,SMALL(IF(Sheet1!$B$1:$B$6=$A8,ROW(Sheet1!$B$1:$B$6)-ROW(Sheet1!$B$1)+1),COLUMNS($B1:B1))),"")

    You'd have to drag it across as it'll put them in separate columns but then you should be able to concatenate them into a single column afterwards.

    You have to have Ctrl and Shift held down when inputting as it's an array formula.

提交回复
热议问题