Home > database >  Excel: Choose selected rows from column based on another column's values and display array
Excel: Choose selected rows from column based on another column's values and display array

Time:08-19

I have two sheets in Excel. Sheet one contains two columns as follows:

column 1:

1
2
3
4
5

column 2:

yes
no
no
no
yes

On sheet 2, I want to display only one column, which contains the values of column 1, sheet 1, where column 2, sheet 1 is set to "yes".

i.e. I expect the output to be:

1
5

How can I do this? Can I use INDEX for this?

CodePudding user response:

You need FILTER() function. Try-

 =FILTER(A1:A5,B1:B5="yes")

Just use proper sheet name in case of different sheet.

enter image description here

  • Related