+ Reply to Thread
Results 1 to 3 of 3

Count a range with two conditions (string and number)

  1. #1
    Registered User
    Join Date
    06-18-2010
    Location
    Tokyo
    MS-Off Ver
    Excel 2013
    Posts
    17

    Count a range with two conditions (string and number)

    A.png

    I want to count the range(HX125:HX153) with 2 conditions:
    1) count only if it has value including "0", so that cells with "-" are not count.
    2) count only if the range(B125:B153) has string "*residential".

    I tried to do it with SUMIF and COUNTIFS but my way is not working.
    Please help. Thank you.

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

    Re: Count a range with two conditions (string and number)

    hi yauchildchew. i dont understand your first criteria. is it non-blanks or above 0? for the former:
    =COUNTIFS(HX125:HX153,"<>",B125:B153,"residential")

    for the latter:
    =COUNTIFS(HX125:HX153,">=0",B125:B153,"residential")

    if all fails, Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    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

  3. #3
    Registered User
    Join Date
    06-18-2010
    Location
    Tokyo
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: Count a range with two conditions (string and number)

    Thank you and I have just figured out it.
    What I did was:
    =COUNTIFS(KU125:KU146,">=0",B125:B146,"=*residential")

    It didn't work when i tried something like:
    =COUNTIFS(KU125:KU146,">=0",B125:B146,"="*residential"")
    =COUNTIFS(KU125:KU146,"<>="-"",B125:B146,"=*residential")

    Thank you so much!

+ 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