+ Reply to Thread
Results 1 to 15 of 15

Formula to decrement

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Formula to decrement

    Hi, Could someone help me get a formula to get column C? Thanks!
    Book3.xlsx
    Capture.JPG
    Attached Images Attached Images
    Last edited by cs02; 08-10-2015 at 11:35 AM.

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Formula to decrement

    Hello
    Try the following formula in column C:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    DBY

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula to decrement

    In C2 copied down

    =IF(A2=A1, C1-B2, A2)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    07-20-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Formula to decrement

    Hi, thanks - that partially works, but it doesn't start fresh when the values change to 192 from 41!

  5. #5
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Formula to decrement

    Hi
    Didn't see the extra screenshot originally, try:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by DBY; 08-10-2015 at 12:13 PM.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula to decrement

    Doesn't my formula work?

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Formula to decrement

    You didn't mention changing values in column A but I suspected that would be the case. Try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Registered User
    Join Date
    07-20-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Formula to decrement

    All answers work! Thanks for your help

  9. #9
    Registered User
    Join Date
    07-20-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Formula to decrement

    If Id like to find the value of column A corresponding to only the first negative value- how can I do that? So say in Column D, I'd like to have the value of Column A only when I hit -1 in column C and so on..

  10. #10
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Formula to decrement

    Hi
    Thank you for the Rep mark, try in column D:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    DBY

  11. #11
    Registered User
    Join Date
    07-20-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Formula to decrement

    This works perfectly fine!! Thanks a bunch! How does it work though-in plain terms? Are you checking to see if the count of similar values in column A and negative values in column C are both 1 and if so, the value of column A is displayed?

  12. #12
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Formula to decrement

    Yes, that's basically it. It counts the number of times the value in column A appears with a negative value in column C. When the count is 1, it returns the A value else it returns a blank "".

  13. #13
    Registered User
    Join Date
    07-20-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Formula to decrement

    Perfect! Thanks again

  14. #14
    Registered User
    Join Date
    07-20-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Formula to decrement

    Hi, this formula =A2-SUMIF($A$2:A2,A2,$B$2:B2) doesn't work when the same range of values appear again in column A. For example if 41 appears again after 192, it counts the values in column C corresponding to the older decrementing values for 41. How can we change this formula to start fresh every time?
    Last edited by cs02; 08-11-2015 at 02:03 PM.

  15. #15
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Formula to decrement

    Hi
    I think with a slight amendment to ChemistB's formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This seems to work. Try it out in C2 down. Kudos ChemistB!

    DBY

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Decrement Cells in Excel
    By funnylion in forum Excel General
    Replies: 3
    Last Post: 06-25-2013, 09:02 PM
  2. increment/decrement a date with spinner
    By excelinator in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2010, 03:17 AM
  3. How to increment / decrement rows / columns ?
    By naveenvarthaan in forum Excel General
    Replies: 1
    Last Post: 09-01-2009, 08:40 AM
  4. [SOLVED] How can I automatically decrement a column in hexadecimal numbers
    By Bonk33r in forum Excel General
    Replies: 4
    Last Post: 08-07-2006, 02:05 PM
  5. [SOLVED] How can I automatically decrement a column in hexadecimal numbers
    By Bonk33r in forum Excel General
    Replies: 0
    Last Post: 08-07-2006, 11:45 AM
  6. cell math to decrement/increment a cell
    By BUFFETT in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-16-2006, 03:45 PM
  7. How do I increment or decrement values in a column?
    By OldKenGoat in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-05-2005, 09:06 PM

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