I'm trying to program a function that will search a column for a specific data set and then compare it to data from another column. Then I want it to count the number of times that the data from one column is the same as the other. I tried:
=sum((countif (A2:a45, "Yes"), countif(b2:b45, "Yes")) I realized that it would just add all of the yeses. I do have the latest version of Excel and it seems to have more functions. Is there a comparison function?
English translation - Compare a2 to b2. If they are both yes, count 1. Then do this for each cells in column a and column b.
![]()
You're looking for a way to count the number of repetitions of a given cell in a column in another column...?
I think?
mew!
Attached example of wild guess? :P
Last edited by mewingkitty; 10-19-2009 at 09:47 PM.
=IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)
If A2:A45 = Yes/No answers
If B2:B45 = Yes/No answers
If C1 = Yes
If C2 = No
Put this formula D1 and copy down:
=SUMPRODUCT(--($A$2:$A$45 & $B$2:$B$45 = C1 & C1))
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
None of those formulae work. I do want a comparison but I want a comparison cell to cell. If the comparison is the same text I want it to count 1.![]()
That's what mine does.
=SUMPRODUCT(--($A$2:$A$45 & $B$2:$B$45 = C1 & C1))
...or another way to look at it:
=SUMPRODUCT(--($A$2:$A$45 & $B$2:$B$45 = "YesYes"))
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks