+ Reply to Thread
Results 1 to 5 of 5

Count if a cell contains a specific number AND any kind of text

Hybrid View

  1. #1
    Registered User
    Join Date
    12-04-2012
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    15

    Count if a cell contains a specific number AND any kind of text

    I have 15 different columns on my spreadsheet. In a drop down box you can select from 1,2,3 or 4.
    From M26:M39 is the "other" column. I still want to put in a 1-4 followed by a brief explanation. For example "1 Eczema" or 3 "Vision". The box must be completed with a number followed by a word or short description of a condition. The condition could be anything though so not specific text.

    In cells Q7, R7, S7, T7 I want to count how many 1s, 2s, 3s or 4s there are along with the text. So it would count "1 Eczema" in M26 and "3 Vision" in M27 with "2" as the result.

    I can see my explanation of this is a little vague, I'm struggling to find the words to describe my problem, so I have attached a file that will hopefully help clarify my issue.

    Thanks,

    Neil.
    Attached Files Attached Files

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Count if a cell contains a specific number AND any kind of text

    Hi Neil,

    See the attached file, yellow cells, where I have used below formula:-

    Formula: copy to clipboard
    =COUNT(IF(ISNUMBER(SEARCH(LEFT(Q7,1)*1,$M$6:$M$39)),ROW($M$6:$M$39),""))


    enter formula using ctrl shift enter key combination..

    Book2.xlsx

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Count if a cell contains a specific number AND any kind of text

    hi macky18, an alternative in Q15 to copy across:
    =SUMPRODUCT(--(LEFT($M$6:$M$39)=COLUMNS($Q15:Q15)&""))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Registered User
    Join Date
    12-04-2012
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Count if a cell contains a specific number AND any kind of text

    Thank you very much, both excellent solutions to my problem.

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Count if a cell contains a specific number AND any kind of text

    You are welcome...

    Cheers


    Regards,
    DILIPandey
    <click on below * if this helps>

+ 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