Question

I have a spread sheet with 5 columns

+----+----+----+----+-------------+
| C1 | C2 | C3 | C4 | C-Aggrogate |
+----+----+----+----+-------------+
|YES |    |    |    | YES         |
|    |YES |    |    | YES         |
|    |    |YES |    | YES         |
|    |    |    |YES | YES         |
|YES |YES |    |    | YES         |
|YES |    |NO  |    | MAYBE       |
|YES |YES |NO  |    | MAYBE       |
|YES |YES |NO  |NO  | MAYBE       |
|NO  |    |    |    | NO          |
|    |NO  |    |    | NO          |
|    |    |NO  |    | NO          |
|    |    |    |NO  | NO          |
+----+----+----+----+-------------+

Columns C1 - C4 are static data from other sources. C-Aggrogate is intended to aggrogate the other columns and highlight when there is a possible discrepency.

The rules for a given row are:

  1. If all columns are blank then C-Aggrogate is blank
  2. If at least one column is Yes and no columns are NO then C-Aggrogate is YES
  3. If at least one column is NO and no columns are Yes then C-Aggrogate is NO
  4. If at least one column is Yes and at least one column is NO then C-Aggrogate is MAYBE

Where would I begin to create the correct formula for C-Aggrogate? YES, NO, MAYBE are jusst sample values, they could be any human-readable values.

Was it helpful?

Solution

Not pretty, but seems to meet your requirement:

=IF(AND(COUNTIF(A1:D1,"YES")>0,COUNTIF(A1:D1,"NO")=0),"YES",
 IF(AND(COUNTIF(A1:D1,"NO")>0,COUNTIF(A1:D1,"YES")=0),"NO",
 IF(AND(COUNTIF(A1:D1,"YES")=0,COUNTIF(A1:D1,"NO")=0),"","MAYBE")))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top