+ Reply to Thread
Results 1 to 5 of 5

Hard to explain question

Hybrid View

  1. #1
    Registered User
    Join Date
    01-07-2005
    Posts
    45

    Hard to explain question

    Ok, here's what I'm looking to do. I will be filling in values on a sheet and I was wondering if it's possible to set up a formula that subtracts 1 from a value each time a different cell is set to anything other then 0.

    http://img244.imageshack.us/img244/6545/picture2rx9.png

    Here's an image to help explain my question. If you look at cell B48 it shows the number 105. Each time I change one of the 0 from the row E to a positive whole number I'd like it to just take -1 to B48. Is that possible?

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,373
    It is possible, but it will require VBA event code associated with the worksheet_change event. This kind of question gets asked quite frequently, so if you use the forums search engine, you should be able to find some sample code to use as a starting point.

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Quote Originally Posted by odditie
    Ok, here's what I'm looking to do. I will be filling in values on a sheet and I was wondering if it's possible to set up a formula that subtracts 1 from a value each time a different cell is set to anything other then 0.

    http://img244.imageshack.us/img244/6545/picture2rx9.png

    Here's an image to help explain my question. If you look at cell B48 it shows the number 105. Each time I change one of the 0 from the row E to a positive whole number I'd like it to just take -1 to B48. Is that possible?
    If you use this formula, it will count how many values in the ranges of column E are above zero, then you can take the total away from B48

    =COUNTIF(E2:E10,">0")+COUNTIF(E13:E22,">0")+COUNTIF(E25:E31,">0")+COUNTIF(E34:E42,">0")
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  4. #4
    Registered User
    Join Date
    01-07-2005
    Posts
    45
    Quote Originally Posted by oldchippy
    If you use this formula, it will count how many values in the ranges of column E are above zero, then you can take the total away from B48

    =COUNTIF(E2:E10,">0")+COUNTIF(E13:E22,">0")+COUNTIF(E25:E31,">0")+COUNTIF(E34:E42,">0")
    Awesome, thank you very much!

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Glad to help - thanks for the feedback

+ 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