+ Reply to Thread
Results 1 to 8 of 8

Sumif with Left

  1. #1
    Registered User
    Join Date
    08-12-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    7

    Sumif with Left

    My data looks like this:
    A B
    12000 100
    14000 200
    31000 500
    33000 600

    What is the formula I should use for this:
    If left(A,1>1) then add column B
    so that result = 1100

    Some more explanation of the problem:
    If the first digit of any number in Col A is greater than 1 (eg. those starting with 3) then add up the amounts in Col B. So that the answer returns 500 + 600 = 1100.
    Last edited by ashtanga; 10-08-2010 at 03:57 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,061

    Re: Sumif with Left

    you talking about first row?

    Well, left is 1 and it's not bigger then 1... So why is B1 1100?
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    09-28-2010
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sumif with Left

    Not sure if I understand your question but here's what I've thought of...

    =IF(LEFT(A1,1)>1,(LEFT(A1,1)&B1)*1,B1)

    or

    =IF(LEFT(A1,1)>=1,(LEFT(A1,1)&B1)*1,B1)

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,736

    Re: Sumif with Left

    Perhaps.....

    =SUMIF(A:A,">=20000",B:B)
    Audere est facere

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Sumif with Left

    Are the numbers in Column A always 5 digits?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  6. #6
    Registered User
    Join Date
    08-12-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Sumif with Left

    yes it is always 5 characters

  7. #7
    Registered User
    Join Date
    08-12-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Sumif with Left

    found this on another forum which works great:
    =Sum(If(Left(A1:A4,1)>"1",B1:B4,0))

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sumif with Left

    I believe dll's solution does what you requested - and more efficiently than the alternative you mention.

+ 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