+ Reply to Thread
Results 1 to 17 of 17

add 1 to a cell when a another cells reaches a certain value

  1. #1
    Registered User
    Join Date
    01-14-2008
    Posts
    76

    add 1 to a cell when a another cells reaches a certain value

    hello ppl

    i wanted to know if there is a formular that would say if a certain cell reaches a certain value it will add 1 to another cell for example

    if cell B2 reaches 24 then 1 would be added to cell B3

    thanks in advance

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Not sure if you want 1 to be in B3, or 1 to be added to the value in B3.

    First

    =IF(B2>=24,1,"")

    Second

    =IF(B2>=24,B3+1,"")
    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

  3. #3
    Registered User
    Join Date
    01-14-2008
    Posts
    76
    hello
    thanks for the reply
    dat formular only adds 1 when da cells goes to 24 but when it goes back down it becomes blank
    i want the formula to keep on adding 1 everytime it reaches 24

    for example

    if you have a table and you wants Cell b15 to add 1 on to B15 everytime cell B14 reaches 24
    eg B14 would reset when it goes to 24

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    You need some VBA code to do that, I'm afraid thats not my expertise. Maybe someone out there can help our friend here - ANYONE THERE!

  5. #5
    Registered User
    Join Date
    01-14-2008
    Posts
    76
    Thanks for your help tho still reali apraciate it

    is there any1 thats noes a VBA code??????

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Can you explain a bit more.

    Is B14 a formula ??

    eg B14 would reset when it goes to 24
    How

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  7. #7
    Registered User
    Join Date
    01-14-2008
    Posts
    76
    noo its not a code
    just a example
    in short
    everytime you type 24 in say B12 then it would add 1 to B13

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Right click your sheet tab > select view code > paste in the below

    When B12 is > = 24 then B13 will increase by 1

    Please Login or Register  to view this content.
    HTH

    VBA Noob

  9. #9
    Registered User
    Join Date
    01-14-2008
    Posts
    76

    Thumbs up

    omg it works
    thanks alot you dont know how much this has helped me
    thanks a alot bro

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Your welcome


    VBA Noob

  11. #11
    Registered User
    Join Date
    01-14-2008
    Posts
    76
    sorry another problem

    u no da code u gave me it works and all
    but on that cell i got a sum forumalr adding range F8:F14
    so if i put da forumlar the forumla deletes
    isent there a way i can keep that same function but i need to sum foumalar to stay
    if u get what i mean

  12. #12
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See if this helps

    If Range F8 to F14 total is 12 and you enter a number in B12 >=24 then B13 will equal value of B13 (12) + 1 + sum total 12 = 25

    Please Login or Register  to view this content.
    VBA Noob

  13. #13
    Registered User
    Join Date
    01-14-2008
    Posts
    76
    thanks for your help

    i have attached a file which explains the problem that i am facing if you could please help me solve it i would be real grateful
    that in advance
    Attached Files Attached Files

  14. #14
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Format cell as
    [h]:mm
    which goes over 24 hrs

    VBA Noob

  15. #15
    Registered User
    Join Date
    01-14-2008
    Posts
    76

    Thanks

    now the proble is that because i formated the cell as "[h]:mm" i cannot times that by a number to find out the wage e.g.

    Cell F15 has the time worked for the week formated as "[h]:mm" but in cell G15 i have put a formula "=F15*6" 6 being the hourly rate but that dont work

    F15 has 36:00 and that multiplied by 6 should equal to 216 but the answer gives me ZERO

    thanks in advance

  16. #16
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See if attached helps

    VBA Noob
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    01-14-2008
    Posts
    76

    Thanks

    Thanks alot bro
    u helped me bareeee
    i was stuck on this problem for bareee time
    i thought i had to change da code and this and that, but it was so simple
    Thanks alot
    reli appreciate it
    thanks again

+ 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