IF Function with multiple criteria

KuraiChikara

Board Regular
Joined
Nov 16, 2016
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
Hello, I am trying to perform an IF function with multiple criteria. I'll explain what I'm trying to do first and then my formula is at the end.

There are 3 columns: Check Mark, Formula, Activity (in A, B & C)

In my example, imagine the "1" to be a check mark to do the activity in column C. If you have only one check mark or "1", that is only one activity to be done and FINE is populated from the formula. However, if another activity has a check mark or a "1" it means that activity is also being conducted at the same time as the first one. So the first selection errors out as a conflict because you can only do one thing at a time.

In the example below, a check mark is placed next to "Walk the Dog," since that's the only activity checked, FINE is populated. There is nothing in Column A next to the other activities so ZERO is populated where the formula is.

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Check Mark[/TD]
[TD]FORMULA[/TD]
[TD]Activity[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Fine[/TD]
[TD]Walk the Dog[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]0[/TD]
[TD]Bath Time[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]0[/TD]
[TD]Dishes[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]0[/TD]
[TD]Laundry[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]0[/TD]
[TD]Crafts[/TD]
[/TR]
</tbody>[/TABLE]


In this example, all activities have a check mark, all activities can't be done all at once so the first 4 activities CONFLICT and the last one is marked as FINE. This behavior is what I'm looking for, the last example is where I'm stumped.


[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Check Mark[/TD]
[TD]FORMULA[/TD]
[TD]Activity[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Conflict[/TD]
[TD]Walk the Dog[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Conflict[/TD]
[TD]Bath Time[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Conflict[/TD]
[TD]Dishes[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Conflict[/TD]
[TD]Laundry[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Fine[/TD]
[TD]Crafts[/TD]
[/TR]
</tbody>[/TABLE]



Final example:
I put a "3" next to Bath Time, 3 has more significance to another project I have. Anyways, because of my formula it will calculate out to CONFLICT.
My formula reads like this:

=IF((A1+A2+A3+A4+A5)>1,"Conflict",IF(A1=1,"Fine",IF(A2=1,"FINE",IF(A3=1,"FINE",IF(A4=1,"FINE",IF(A5=1,"FINE",0))))))

Add Columns A1, A2, A3, A4 and A5 together, if greater than "1", put CONFLICT.
If not greater than "1" and A1, A2, A3, A4 or A5 just equals "1" put FINE.

What I want my formula to do, with columns A1, A2, A3, A4 and A5, is if it JUST equals 1 OR has a 1 AND specifically has a 3, to show FINE.
I don't know how to include the 3 like that.


I would like THIS:

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Check Mark[/TD]
[TD]FORMULA[/TD]
[TD]Activity[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Conflict[/TD]
[TD]Walk the Dog[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Conflict[/TD]
[TD]Bath Time[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Conflict[/TD]
[TD]Dishes[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Conflict[/TD]
[TD]Laundry[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Fine[/TD]
[TD]Crafts[/TD]
[/TR]
</tbody>[/TABLE]


To look like THIS:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Check Mark[/TD]
[TD]FORMULA[/TD]
[TD]Activity[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Conflict[/TD]
[TD]Walk the Dog[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Fine[/TD]
[TD]Bath Time[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Conflict[/TD]
[TD]Dishes[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Conflict[/TD]
[TD]Laundry[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Fine[/TD]
[TD]Crafts[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Sorry about the edit. I think more specifically I want my formula to look like THIS instead of what I originally stated.

[TABLE="class: cms_table_grid, width: 500, align: center"]
<tbody>[TR]
[TD]Check Mark[/TD]
[TD]FORMULA[/TD]
[TD]Activity[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]0[/TD]
[TD]Walk the Dog[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Fine[/TD]
[TD]Bath Time[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]0[/TD]
[TD]Dishes[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]0[/TD]
[TD]Laundry[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Fine[/TD]
[TD]Crafts[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Hi,

I believe this covers all your scenarios:


Book1
ABC
1Check MarkFORMULAActivity
20Walk the Dog
33FineBath Time
41ConflictDishes
51FineLaundry
60Crafts
Sheet148
Cell Formulas
RangeFormula
B2=IF(A2="",0,IF(A2=3,"Fine",IF(COUNTIF(A$2:A$6,1)-COUNTIF(A1:A$2,1)=1,"Fine","Conflict")))


B2 formula copied down.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top