+ Reply to Thread
Results 1 to 7 of 7

Can't get the correct calculation

  1. #1
    Registered User
    Join Date
    02-02-2008
    Posts
    4

    Can't get the correct calculation

    =COUNTIF(C30,"<0")

    How do I make this continually count when the number in c30 changes? (c30 is a sum of other cells)
    In other words, I want it to count the negative numbers as positive numbers. For instance, a (-1) in c30 using the above calculation shows it as a 1. Now, when c30
    = -2, I want this calculation to show (2), but it shows as 1, no matter how far in the negative c30 goes. I'm sorry that I can't explain it any better than that. If anybody gets what I am saying and can help, please do. Thanks in advance.
    Paul

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,706
    Your formula simply counts the number of negative numbers in the cell C30, as C30 is a single cell it can only contain at most 1 number so that formula only ever returns 0 or 1. Try

    =ABS(C30)

  3. #3
    Registered User
    Join Date
    02-02-2008
    Location
    Caledon, Ontario, Canada
    Posts
    3
    Quote Originally Posted by bass4fam
    =COUNTIF(C30,"<0")

    How do I make this continually count when the number in c30 changes? (c30 is a sum of other cells)
    In other words, I want it to count the negative numbers as positive numbers. For instance, a (-1) in c30 using the above calculation shows it as a 1. Now, when c30
    = -2, I want this calculation to show (2), but it shows as 1, no matter how far in the negative c30 goes. I'm sorry that I can't explain it any better than that. If anybody gets what I am saying and can help, please do. Thanks in advance.
    Paul
    Maybe you are looking for a formula instead of a COUNTIF Why don't you try the following =IF(C30<0,C30*-1,C30)

    Good Luck, Yves

  4. #4
    Registered User
    Join Date
    02-02-2008
    Posts
    4

    Tried, but no luck

    Quote Originally Posted by farnorth50
    Maybe you are looking for a formula instead of a COUNTIF Why don't you try the following =IF(C30<0,C30*-1,C30)

    Good Luck, Yves
    I gave it a shot but all i ever get in my box is 1

    Thanks for
    the attempt.

  5. #5
    Registered User
    Join Date
    02-02-2008
    Location
    Caledon, Ontario, Canada
    Posts
    3

    Try this one

    Than try this, I was not sure what you where trying to do...hopefully this is what you are looking For

    =IF(SUM(C1:C29)<0,SUM(C1:C29)*-1,SUM(C1:C29))

    You might have to change the cell numbers cause I'm not sure where the sum is coming from...

    good luck. send me a copy of the worksheet that your'e working with...than I bet able to get a better picture.

  6. #6
    Registered User
    Join Date
    02-02-2008
    Location
    Caledon, Ontario, Canada
    Posts
    3
    Quote Originally Posted by farnorth50
    Than try this, I was not sure what you where trying to do...hopefully this is what you are looking For

    =IF(SUM(C1:C29)<0,SUM(C1:C29)*-1,SUM(C1:C29))

    You might have to change the cell numbers cause I'm not sure where the sum is coming from...

    good luck. send me a copy of the worksheet that your'e working with...than I bet able to get a better picture.
    Example: if you want -5 to look like (5)or -2 to look like (2) when negative, than that is a Format issue, Right click on the Cell that you want to change Select the number to format and voila, Problem solved,

  7. #7
    Registered User
    Join Date
    02-02-2008
    Posts
    4

    Problem Solved

    When I was able to better explain this problem, the calculation was solved quickly, thanks to daddylonglegs. I needed an on duty column, which dropped below a minimum number to calculate the amount of ot needed in another cell. This was the fix.

    Say that "on duty column" is cell A1 then try this formula for ot needed

    =MAX(0,6-A1)

    If A1 is 6 or higher this will show zero but if A1 falls below 6 then this will show the shortfall.


    Thanks to all that responded.

+ 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