+ Reply to Thread
Results 1 to 7 of 7

Count how many times a negative number occurs

  1. #1
    Registered User
    Join Date
    04-04-2012
    Location
    Somerset, England
    MS-Off Ver
    365
    Posts
    13

    Question Count how many times a negative number occurs

    Lets say I have a formula in A1 which adds A2+B2...

    In C1 I want a formula to 'count' how many times A1 equals a negative number... i.e. IF A1 = <=-1, +1

    I hope this makes sence, please let me know if you'd like futher explanation.

    Ben

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

    Re: Count how many times a negative number occurs

    Something like this:
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-04-2012
    Location
    Somerset, England
    MS-Off Ver
    365
    Posts
    13

    Re: Count how many times a negative number occurs

    I don't think so, I want C1 to count the number of times that A1 goes negative.. not the result of adding/subtracting

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: Count how many times a negative number occurs

    Which is what it does...

  5. #5
    Registered User
    Join Date
    04-04-2012
    Location
    Somerset, England
    MS-Off Ver
    365
    Posts
    13

    Re: Count how many times a negative number occurs

    Sorry, you're right it does, I've just tested it again.. another question related...

    Any idea of how I can get the macro to run automatically any time A2 or B2 is edited?

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: Count how many times a negative number occurs

    Which is what it does

  7. #7
    Registered User
    Join Date
    04-04-2012
    Location
    Somerset, England
    MS-Off Ver
    365
    Posts
    13

    Re: Count how many times a negative number occurs

    I've tested it and if I remove the numbers that are in A2 and B2 already, then enter say -4 & -5 C1 does not automatically update.. I have to manually run the macro

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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