+ Reply to Thread
Results 1 to 5 of 5

data searching and counting

  1. #1
    Registered User
    Join Date
    10-19-2009
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Thumbs down data searching and counting

    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.

  2. #2
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: data searching and counting

    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
    Attached Files Attached Files
    Last edited by mewingkitty; 10-19-2009 at 08:47 PM.
    =IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: data searching and counting

    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 the icon 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!)

  4. #4
    Registered User
    Join Date
    10-19-2009
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: data searching and counting

    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.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: data searching and counting

    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"))
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1