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