Compare cell values in same column with other conditions in Excel - excel

In below table in Excel, there are multiple columns, attaching 3 column just as an example. There are duplicates in ID column. Col1 has yes/no values.
I want to create a new column which will display Yes in case any value in Col1 is Yes for a particular ID.
E.g. if ID=1, if it contains at least one "yes" value in col1, then new_col should display yes.
If for an ID=3, all No, then new_col=No. I want to build an Excel formula. Please help.
ID Col1 New_Col
1 Yes Yes
1 No Yes
2 Yes Yes
3 No No
3 No No
3 No No
4 No No

Use:
=IF(COUNTIFS(A:A,A2,B:B,"Yes"),"Yes","No")

Related

In a 2 column grid, match multiple values from the first column, and add the associated values for each from the second column

Consider this set:
A
B
YES
1
NO
3
NO
3
NO
2
NO
5
YES
2
YES
1
I would like to create a formula that will choose all the values for "YES" from column 1, and for each match, add the values from column 2 (4).
I've attempted this using =SUM(VLOOKUP("YES",A1:B7, 2, FALSE) But this only returns the number of the first value found.
Any ideas how I can do this?
Use SUMIFS:
=SUMIFS(B:B,A:A,"YES")

COUNT values in one Column for Distinct Value in Another Column - EXCEL

Hello All,
I have two columns in Excel Worksheet and want to count column 2 for distinct values in Column 1.
Table:
Column 1
Column 2
Apple
Yes
Orange
Yes
Apple
Yes
Banana
No
Grapes
No
Banana
No
Orange
Yes
Desired OUTPUT / RESULT:
Column 1
Column 2
YES
2
NO
2
Please help.
Thank You
Try below formula-
=SUMPRODUCT(($B$2:$B$8=E2)/COUNTIF($A$2:$A$8,$A$2:$A$8&""))
If you have Excel365 then use below formulas-
E2=UNIQUE(B2:B8)
F2=COUNTA(UNIQUE(FILTER($A$2:$A$8,$B$2:$B$8=E2)))

Excel conditional formatting

I was hoping someone can help me with a formula.
What I am trying to do is format a number as currency if the column 3 to its left contains a specific text.
For example,
Col1, Col2, Col3
YES a 5$
NO b 4
YES c 3$
In this case 5 and 4 are formatted as currency since their corresponding Col1 is YES.
Use:
=$A1="YES"
As the formula and apply it to Column C

Excel Pivot count occurances under condition

In excel, and preferably using pivot tables, I want to count the number of occurrences that have a specific value for different line items.
Tom | yes
Tom | no
Max | n/r
Max | yes
Max | yes
Max | no
The pivot table should have two line items (Max/Tom), one column that counts the sum of occurrences of "yes" and "no" and one column that counts only "yes". The result would be that I can say "Max has won 2 out of 3 relevant cases; Tom has won 1 out of 2 relevant cases"
I know how to do it with formulas, but was wondering if using pivot-tables is also a possibility.
If you can add helper columns I would add two, one for yes and one for no. In the yes column (assuming your data starts in cell A1), in C2 type =--(B2="yes") then in D2 type =--(B2="no")
This will return a 1 if the cell is yes or no like follows:
Name Data Yes No
Tom yes 1 0
Tom no 0 1
Max n/r 0 0
Max yes 1 0
Max yes 1 0
Max no 0 1
Then create a pivot table, put Name as Row Labels, then in Values have Sum of Yes and Sum of No
http://oi63.tinypic.com/10z5j55.jpg
Additional fields are not necessary. When creating the pivot table, set Name equal to your Row value and Data for your Columns value. Then, drag the Name field into the Values area and voila! Screenshot attached.

Advanced Excel 2007 selecting mutually exclusive observations in columns

I have a table like the one below
Place Col 1 Col 2 Col 3
1 yes yes yes
2 no yes yes
3 yes no yes
4 no no no
5 no no no
6 no no no
7 no no no
I need to select the first yes in the the first column, once selected that place cannot be used in the second or third columns. For example the first yes in col 2 cannot be 1 because it was used in column 1 therefore I select the yes in position 2. In the third column we can't select the first or second yes because they have been used in col1 and col 2 therefore the only available first in line yes is number 3. I need this to be driven by formulas i.e. change randomly the order of yes and nos but never have the same yes selected in the same position regardless of column.
For example we can show the yes positions down the bottom like
Col 1 Col 2 Col 3
1 2 3
Under the column 1, use this formula:
=MATCH("yes",B$2:B$8,0),
where B$2:B$8 is the data in the first column.
Under the column 2, use this formula:
=MATCH("yes",IF(ISERROR(MATCH(ROW(C$2:C$8)-ROW(C$2)+1,$B$12:B$12,0)),C$2:C$8,"no"),0)
where B12 is the cell with the first formula.
Make sure you press Ctrl+Shift+Enter to enter this formula.
Drag the second formula to the right for as many columns as you want.

Resources