Populate a new value based on a range

marcus314

New Member
Joined
Jun 4, 2014
Messages
20
Hello all,

I have a range of cells with either one or more “Yes” values, one or more “No” values, or a combination of both “Yes” and “No” values.

I’m wishing to populate in a new cell based on the following logic.
-If one or all cells in a given range contain “Yes”, then populate the result cell with “Yes”
-If one or all cells in a given range contain “No”, then populate the result cell with “No”
-If there is a mixture of both “Yes” and “No” in a given range (irrespective of the combination), then populate the result cell with “Ambivalent”

Book2
ABCDE
1Q1aQ1bQ1cQ1dRESULT
2Yes
3Yes
4Yes
5Yes
6No
7No
8No
9No
10YesYes
11YesYes
12NoNo
13NoNo
14YesNo
15NoYes
16YesNo
17NoYes
18NoNoNoYes
19YesYesYesNo
Sheet1


Any easy ways of accomplishing this?

Thanks!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Upvote 0
Solution
Try this (for the range A10:D10):
Excel Formula:
=IF(AND(COUNTIF(A10:D10,"Yes"),COUNTIF(A10:D10,"No")),"Ambivalent",IF(COUNTIF(A10:D10,"Yes"),"Yes",IF(COUNTIF(A10:D10,"No"),"No","")))
 
Upvote 0
You guys are awesome! I'm working through to deconstruct the logic behind the formulas now. Thanks a million!
 
Upvote 0
Hi all,

What if I wanted to simplify the output and simply input "Multi" if there is more than one value in a given range? Below is my expected output:

Book4
ABCDE
1Q1aQ1bQ1cQ1dRESULT
2YesYes
3YesYes
4YesYes
5YesYes
6NoNo
7NoNo
8NoNo
9NoNo
10YesYesMulti
11YesYesMulti
12NoNoMulti
13NoNoMulti
14YesNoMulti
15NoYesMulti
16YesNoMulti
17NoYesMulti
18NoNoNoYesMulti
19YesYesYesNoMulti
Sheet1


Any ideas?

Thanks again!
 
Upvote 0
Hi all,

What if I wanted to simplify the output and simply input "Multi" if there is more than one value in a given range? Below is my expected output:

Book4
ABCDE
1Q1aQ1bQ1cQ1dRESULT
2YesYes
3YesYes
4YesYes
5YesYes
6NoNo
7NoNo
8NoNo
9NoNo
10YesYesMulti
11YesYesMulti
12NoNoMulti
13NoNoMulti
14YesNoMulti
15NoYesMulti
16YesNoMulti
17NoYesMulti
18NoNoNoYesMulti
19YesYesYesNoMulti
Sheet1


Any ideas?

Thanks again!
This should do what you want:
Excel Formula:
=IF(COUNTA(A10:D10)>1,"Multi",IF(COUNTIF(A10:D10,"Yes"),"Yes",IF(COUNTIF(A10:D10,"No"),"No","")))
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,285
Members
452,902
Latest member
Knuddeluff

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