Home > Enterprise >  Is there a for loop in excel?
Is there a for loop in excel?

Time:06-03

 --- ----- 
| A | Inc |
 --- ----- 
| A | Exc |
 --- ----- 
| B | Exc |
 --- ----- 
| B | Exc |
 --- ----- 

This is the table I have, I have created a column of unique values in the first column (A,B)

Now if the rows with A have even one Include I want the add a column next to the Unique value column that says include. If there are no Includes it should be exclude. So it should look like this -

 --- ----- 
| A | Inc |
 --- ----- 
| B | Exc |
 --- ----- 

CodePudding user response:

Use COUNTIFS()

=IF(COUNTIFS(A:A,E1,B:B,"Inc"),"Inc","Exc")

enter image description here

  • Related