Need help reading 2 columns and extracting data under certain conditions

WhoaBundy

New Member
Joined
Oct 2, 2011
Messages
1
I have two columns. In one people either saw Red, Blue, or Green. In the other people either chose One, Two, or Three.

I would like to get excel to read the first column, find all the times someone picked red, then look to the column next to it and see if they picked the number One. Then I would like it to count that situation. Then I want to do it for Two and Three. In the end I would have something that looked like this


---------One----Two---Three
Red-------5------8-------9
.
Blue-------4------5-------3
.
Green-----4------2-------6


Generated from something that looks like this


Red One

Blue Two

Blue Three

Green Two

Some kind of biconditional countif maybe
 
Last edited:

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi and welcome to the forum.

You can do this using the Sumproduct() function.

Excel Workbook
ABCDEFG
1ColourNumberxColourOneTwoThree
2RedOnexRed110
3BlueTwoxBlue011
4BlueThreexGreen010
5GreenTwox
6RedTwox
Sheet1


--($A$2:$A$6=$D2)
The two dashes denote the unary character which tests if the statement is true or false.
So this tests over the specified range in column A to see if a there is a match for the value in D2, i.e., red.

--($B$2:$B$6=$E$1)
This tests for a True/False match for the value in E1, "One" over the specified range in column B.

Combining them together will count count the number of instances where both statements are true and give you the results you are looking for, see the sample data.

 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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