Create a smaller list based off of a list when a certain condition is met in excel

StackOverflow https://stackoverflow.com/questions/23313430

  •  10-07-2023
  •  | 
  •  

문제

I have a list of names in column A. In column B I have "Pass" or "Fail". What formula could I use in Column C that will condense the list in Column A to reflect only the names of the people who have a corresponding "Fail" in Column B. Here is a quick example:

Column A Column B Desired Result for Column C Joe Pass Steve Steve Fail Bob Bob Fail Al Gary Pass Al Fail Will Pass Nathan Pass

Thank you in advance.

도움이 되었습니까?

해결책

We will use a "helper" column.

In D1 enter:

=IF(B1="Fail",1,"")

in D2 enter:

=IF(B2="fail",1+MAX($D$1:D1),"")

and copy down

In C1 enter:

=IFERROR(INDEX(A:A,MATCH(ROW(),D:D,0)),"")

and copy down

Here is a sample:

sample

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top