+ Reply to Thread
Results 1 to 6 of 6

Formula Query - COUNTIF? Column A contains word and Column B contains word

  1. #1
    Registered User
    Join Date
    11-13-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Question Formula Query - COUNTIF? Column A contains word and Column B contains word

    Any advice would be hugely appreciated:

    Column A details year numbers in the format 2013, 2014 etc

    Column B details names e.g. John Smith
    N.B. sometimes the cell will contain more than one name e.g John Smith, Jane Smith

    I want to count how many times John Smith appears in column B if column A shows 2013 (on the same row). This needs to take into account as detailed above that Column B may sometimes contain more than one name.

    Please help!

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Formula Query - COUNTIF? Column A contains word and Column B contains word

    =COUNTIFS(A1:A5000,2013,B1:B5000,"*John Smith*")

    * = Wildcard value. In this expression is means anything+"John Smith"+anything. It would even count John Smith in "djfjohn smith132srs"
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Formula Query - COUNTIF? Column A contains word and Column B contains word

    sumproduct(IF(A1:A100="2013",1,0)*IF(NOT(ISERROR(FIND(1,"JOHN SMITH",A1:A100)))))
    I think, it's an array formula so confirm with ctrl+shift+enter.

  4. #4
    Registered User
    Join Date
    11-13-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Formula Query - COUNTIF? Column A contains word and Column B contains word

    Quote Originally Posted by daffodil11 View Post
    =COUNTIFS(A1:A5000,2013,B1:B5000,"*John Smith*")

    * = Wildcard value. In this expression is means anything+"John Smith"+anything. It would even count John Smith in "djfjohn smith132srs"
    Thanks for the response - This worked great. If only the function was recognised in Google Spreadsheets! I'll just have to export the data to Excel. (Company's decision to use all things Google)

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Formula Query - COUNTIF? Column A contains word and Column B contains word

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  6. #6
    Registered User
    Join Date
    11-13-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Exclamation Re: Formula Query - COUNTIF? Column A contains word and Column B contains word

    Quote Originally Posted by arlu1201 View Post
    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    Thank you for your comment however the language used is not the most friendly. I've just finished working after 28 hours straight on a time critical project. I have not had the opportunity to catch up with my admins.

    That being said I will now be thanking those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA to enter a word, find said word in string of column & copy to another column
    By tuneloon in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-29-2012, 11:59 AM
  2. Adding Brackets Around A Word Based On Word In Another Column
    By jessekanclerz in forum Excel General
    Replies: 1
    Last Post: 11-29-2010, 10:45 PM
  3. Replies: 6
    Last Post: 02-24-2010, 07:07 AM
  4. How to search for a word in a column and have entire row opaque once word is found
    By copleyr in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-04-2009, 07:11 PM
  5. Replies: 5
    Last Post: 11-18-2005, 06:10 PM

Tags for this Thread

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