+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : Checking if number is positive

Hybrid View

  1. #1
    Registered User
    Join Date
    02-13-2009
    Location
    sg
    MS-Off Ver
    Excel 2007
    Posts
    36

    Checking if number is positive

    Hi,

    I am trying to sum up all the positive numbers of the search

    each column has a identifier and it should add up positive weight of the identifiers in the same group.

    example.
    cell 1 +3,boy
    cell 2 -2, boy
    cell 3 +1, boy
    cell 4 +3, girl

    if the identifier is boy
    then it should add up only the positive values of boy which is 3 and 1 = 4

    but my function includes the -2 into the summation.

    any help will be appreciated

    thanks


    =SUM(IF((IF(ISNUMBER(FIND(BA$8,$AV11,1)),LEFT($AV11,2),0))>0,LEFT($AV11,2),0),
    IF((IF(ISNUMBER(FIND(BA$8,$AW11,1)),LEFT($AW11,2),0))>0,LEFT($AW11,2),0),
    IF((IF(ISNUMBER(FIND(BA$8,$AX11,1)),LEFT($AX11,2),0))>0,LEFT($AX11,2),0),
    IF((IF(ISNUMBER(FIND(BA$8,$AX11,1)),LEFT($AY11,2),0))>0,LEFT($AY11,2),0),0)
    Last edited by superkid; 02-16-2009 at 01:41 AM.

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

    Re: Checking if number is positive

    Perhaps

    D1: 
    =SUMPRODUCT(--(RIGHT($A$1:$A$4,LEN($C1))=$C1),--(LEFT($A$1:$A$4,1)="+"),0+LEFT($A$1:$A$4,FIND(",",$A1&",")-1))
    
    Where:
    A1:A4 = values
    C1: boy
    (changing C1 to girl should generate result of 3)
    If the positive numbers are not preceded by the + operator you could repeat the 0+ test and just ensure it's greater than 0 .. however if you do have the + / - operator the above requires less coercion.

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

    Re: Checking if number is positive

    Revised formula based on my interpretation of yours such that:

    
    BA$8 = criteria (boy)
    AV11:AY11 = valuess
    
    Result:
    =SUMPRODUCT(--(RIGHT($AV11:$AY11,LEN(BA$8))=BA$8),--(LEFT($AV11:$AY11,1)="+"),0+LEFT($AV11:$AY11,FIND(",",$AV11:$AY11&",")-1))

+ 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