+ Reply to Thread
Results 1 to 9 of 9

Count IF

  1. #1
    Registered User
    Join Date
    02-27-2009
    Location
    saco
    MS-Off Ver
    Google Docs
    Posts
    59

    Count IF

    i have a workbook that im trying to make...almost done thank god...trying to figure one thing out though.

    i have this formula : =COUNTIF(line," solo")

    what i would like to have this do is to check a singular cell for multiple words
    example:

    g4 contains the word "solo"
    g5 contains the word "dsl/voice"
    now "solo" would count as 1 unit and "dsl/voice" would count as 2 units
    How can i have this formula do this so it searches each word but only counts it if it is present? also if it contains the "dsl/voice" to times that by 2?

    Each month these lines change.


    I hope thats clear hehe

    Thanks for all the help guys

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Count IF

    dont put stuff in one cell! is the recommended way
    but a bigger example of data would be a help ahat exactly are you counting?
    you could just see if there is a ? and multiply by 2 eg =COUNTIF(A1:A10,"*/*")
    Last edited by martindwilson; 12-28-2009 at 03:41 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    02-27-2009
    Location
    saco
    MS-Off Ver
    Google Docs
    Posts
    59

    Re: Count IF

    i have a spreadsheet with sales info
    solo
    dsl/voice
    voice
    cable

    now all but dsl/voice count as 1 unit
    dsl/voice count as 2

    each row is a sale... with info on that sale

    username customername date linetype salesperson units

    A1 davidjmor David Morin 12/28/09 dsl/voice sboud 2
    A2 testuser test guy 12/28/09 solo sboud 1

    above is what the row looks like, the linetype is what i want to count....so the username davidjmor would count as 2 units and the testuser would count as 1 unit. now A1 next month might be a "solo" so it would count as 1. how can i change the "units" column to count that cell to see what it is and then apply appropriate number there.

  4. #4
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    540

    Re: Count IF

    Are there line types with more than a single "/" in the text eg could you have "solo/dsl/voice" or is it a case of either zero "/" or 1 "/"?

    If it's the latter case (i.e. a maximum of 1 "/" in the linetype) , you could use something like the following formula into the required cell:

    Please Login or Register  to view this content.
    and copy down.

    this will enter a 1 if there is no "/" in the linetype. Otherwise it will enter 2.
    Excel 365 user. To unblock a downloaded macro-enabled workbook, go to your "Downloads" folder > right click on the workbook name > click 'Properties' > check the 'Unblock' checkbox. You can now open the workbook.

  5. #5
    Registered User
    Join Date
    02-27-2009
    Location
    saco
    MS-Off Ver
    Google Docs
    Posts
    59

    Re: Count IF

    =IF(ISERROR(FIND("/",G4,1)),1,2)

    That worked perfect.......Thank you so much!!!!

  6. #6
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    540

    Re: Count IF

    You're welcome- make sure to mark your post as solved (Go to your original post to do that).

  7. #7
    Registered User
    Join Date
    02-27-2009
    Location
    saco
    MS-Off Ver
    Google Docs
    Posts
    59

    Re: Count IF

    one last thing...i hate to be a bother but is there a way to make it so that if cell is empty to display 0 or nothing at all?

  8. #8
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    540

    Re: Count IF

    Please Login or Register  to view this content.
    should do it for blank cells. Substitute alternative text in quotes (for the red zero) if you don't want a 0 displayed e.g. "no sale"

  9. #9
    Registered User
    Join Date
    02-27-2009
    Location
    saco
    MS-Off Ver
    Google Docs
    Posts
    59

    Re: Count IF

    Quote Originally Posted by deadlyduck View Post
    Please Login or Register  to view this content.
    should do it for blank cells. Substitute alternative text in quotes (for the red zero) if you don't want a 0 displayed e.g. "no sale"
    Thank you so much again man!!! You rock

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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