Consulting

Results 1 to 9 of 9

Thread: Sumproduct instead of countif. 1 digit numbers problem.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Aug 2013
    Posts
    4
    Location
    Quote Originally Posted by fleskj View Post
    Ha! I was wondering if there is a simple formula Thanks, xld!
    Quick question though, how can I replace this "6" (with the quotes) with a cell reference?
    If I've got 6 in the B6 cell for example,
    =SUMPRODUCT(--(MID(A1:A10,2,1)=B6)) won't work
    I've figured it out,
    it should be
    =SUMPRODUCT(--(MID(A1:A10,2,1)+0=B6)) for it to work

    EDIT: scratch that, it leaves me with the original problem of 1 digit cells, nevermind

    Quote Originally Posted by SamT View Post
    In VBA, Place the Keyboard cursor inside a word and press F1 for help on that word.
    Thanks! I'll look into that.
    Last edited by fleskj; 08-09-2013 at 09:55 AM.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    It doesn't work for the same reason that your original formula doesn't work, you are comparing numeric items with strings. You need to string it

    =SUMPRODUCT(--(MID(A1:A10,2,1)=TEXT(B6,"General")))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •