+ Reply to Thread
Results 1 to 4 of 4

Find & CountIf returning different results?

  1. #1
    Registered User
    Join Date
    10-16-2013
    Location
    Queensland, Australia
    MS-Off Ver
    MS365, Version 2202
    Posts
    73

    Find & CountIf returning different results?

    Hi Guys,

    I have a list of phone numbers, I want to count the number of 13 and 1300 numbers called.

    Please Login or Register  to view this content.
    returns 0. Which I know is wrong.

    when performing a ctrl+F Find all with the same search criteria (13*, 1300*) it finds the correct data/numbers.

    I'm lost and confused?

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

    Re: Find & CountIf returning different results?

    hi Christopher. using the asterisk only works for texts. and even if it works for numbers, you will be double counting them.
    1311
    13001
    the above would be 3 counts (2 of them starts with 13, 1 of them start with 1300)

    so try:
    =SUMPRODUCT((LEFT(K4:K99999,2)="13")*(MID(K4:K99999,3,2)<>"00")+(LEFT(K4:K99999,4)="1300"))

    SUMPRODUCT is a little heavy on resources. so don't range up that much if you don't need to

    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
    10-16-2013
    Location
    Queensland, Australia
    MS-Off Ver
    MS365, Version 2202
    Posts
    73

    Re: Find & CountIf returning different results?

    Again and again I'm amazed at what you guys can do with excel. That works perfectly perfectly perfectly! I will keep in mind what you said about range, maybe learn how to code to the first empty cell in a range to the internets!

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

    Re: Find & CountIf returning different results?

    =) glad to help. anyways, i was in a rush earlier & just wanted to give you a solution that substitutes what you were trying to do. thinking it over, i couldn't visualize a scenario you have that will fail if you simply do:
    =SUMPRODUCT(--(LEFT(K4:K99999,2)="13"))

    since 1300 also begins with "13". unless you just want those beginning wit "1300", then you would have to use:
    =SUMPRODUCT(--(LEFT(K4:K99999,4)="1300"))

    my formula in post #2 will work. but it's just unnecessary to put in so many arguments.

+ 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. Replies: 6
    Last Post: 02-25-2023, 06:05 PM
  2. [SOLVED] Trouble with Find Error Checking: Is Nothing and Is Not Nothing returning the same results
    By k64 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2013, 09:02 PM
  3. [SOLVED] CountIF returning results to multiple cells
    By mroberts in forum Excel General
    Replies: 7
    Last Post: 11-14-2012, 03:07 PM
  4. Help returning different results with the same value
    By araujo3rd in forum Excel General
    Replies: 5
    Last Post: 10-23-2012, 07:22 AM
  5. [SOLVED] SUMPRODUCT not returning the right results
    By Sthlm in forum Excel General
    Replies: 4
    Last Post: 06-25-2012, 06:35 AM

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