+ Reply to Thread
Results 1 to 9 of 9

newbie: count total of number in strings

  1. #1
    Registered User
    Join Date
    08-21-2004
    Posts
    17

    Unhappy newbie: count total of number in strings

    Assumed that I have a four columns as follow:
    a1 b1 c1 d1

    6a 3a 7a

    All I want is to count the total of cell:a1,b1,c1 and place the total number in d1 cells. I put the formula =SUMIF(a1:c1,"*a",a1:c1) in the cell d1, but it don't work.
    Now I'm really need you help to solve above problem.
    Please help me.
    many thanks.

  2. #2
    Forum Contributor
    Join Date
    09-05-2004
    Location
    Melbourne
    Posts
    193
    Use this formula if "A" will always be the only & last character in the cell.

    =SUMPRODUCT(--(RIGHT(A1:C1,1)="A"),INT(LEFT(A1:C1,LEN(A1:C1)-1)))

    Cheers!

  3. #3
    Forum Contributor
    Join Date
    09-05-2004
    Location
    Melbourne
    Posts
    193
    The above formula will return #VALUE! if one of the cells in the range does not have more than 2 characters.

    Try

    =SUMPRODUCT(--(RIGHT(A1:C1,1)="A"),IF(LEN(A1:C1)<=1,0,INT(LEFT(A1:C1,LEN(A1:C1)-1))))

    and on exit press CTRL+SHIFT+ENTER to give

    {=SUMPRODUCT(--(RIGHT(A1:C1,1)="A"),IF(LEN(A1:C1)<=1,0,INT(LEFT(A1:C1,LEN(A1:C1)-1))))}

    Cheers!

  4. #4
    Registered User
    Join Date
    08-21-2004
    Posts
    17
    thank all you for the quick reply.
    I'll try it now

  5. #5
    Registered User
    Join Date
    08-21-2004
    Posts
    17

    Talking

    thank you very much.
    I asked myself when I could input formula into cells like you.
    All you are excel expert.
    thanks again

  6. #6
    Registered User
    Join Date
    08-21-2004
    Posts
    17

    Unhappy

    Help me! Help me
    Once again, thank you for your reply and sorry for my above unclear post.
    Your formula works quite well but only if there are only numbers 2a, 4a, 5a, 8a etc.
    It don't count total exactly in the case that the value is 2.3a 5 1.5 a 4 7 0.5a etc
    I really need your help on this issue. thank you in advanced.

  7. #7
    Registered User
    Join Date
    08-21-2004
    Posts
    17

    Red face

    could anyone help me, please?
    I really need your help on this problem.
    thanks

  8. #8
    Registered User
    Join Date
    08-21-2004
    Posts
    17

    Red face

    Coud anyone help me please?
    thanks

  9. #9
    Forum Contributor
    Join Date
    11-09-2004
    Posts
    451
    type sums("a1:c1") at cell d1

    use this function


    Function SUMS(R As Range)
    Dim s As Double


    For Each c In R
    s = s + (Mid(c.Value, 1, Len(c.Value) - 1))
    Next
    SUMS = s

    End Function

+ 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