+ Reply to Thread
Results 1 to 4 of 4

How do I increment or decrement values in a column?

  1. #1
    OldKenGoat
    Guest

    How do I increment or decrement values in a column?

    I have a column of the numbers 1 and 0. In an adjacent column, I want to
    increment or decrement the value by 1. I know there's a simple way to do
    this, but, I can't see it! Thanks for any help, OldKenGoat
    Example:
    Col A Col B
    0 0
    1 1
    1 2
    1 3
    0 2
    1 3
    1 4
    0 3
    0 2
    0 1
    0 0
    1 1
    1 2
    0 1





  2. #2
    Niek Otten
    Guest

    Re: How do I increment or decrement values in a column?

    In B2:

    =B1+(IF(A2=0,-1,1))

    Fill down

    --

    Kind Regards,

    Niek Otten

    Microsoft MVP - Excel

    "OldKenGoat" <[email protected]> wrote in message
    news:[email protected]...
    >I have a column of the numbers 1 and 0. In an adjacent column, I want to
    >increment or decrement the value by 1. I know there's a simple way to do
    >this, but, I can't see it! Thanks for any help, OldKenGoat
    > Example:
    > Col A Col B
    > 0 0
    > 1 1
    > 1 2
    > 1 3
    > 0 2
    > 1 3
    > 1 4
    > 0 3
    > 0 2
    > 0 1
    > 0 0
    > 1 1
    > 1 2
    > 0 1
    >
    >
    >
    >




  3. #3
    Bob Phillips
    Guest

    Re: How do I increment or decrement values in a column?

    B1: =A1
    B2: =B1+(IF(A2=0,-1,1))

    and copy B2 down

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "OldKenGoat" <[email protected]> wrote in message
    news:[email protected]...
    > I have a column of the numbers 1 and 0. In an adjacent column, I want to
    > increment or decrement the value by 1. I know there's a simple way to do
    > this, but, I can't see it! Thanks for any help, OldKenGoat
    > Example:
    > Col A Col B
    > 0 0
    > 1 1
    > 1 2
    > 1 3
    > 0 2
    > 1 3
    > 1 4
    > 0 3
    > 0 2
    > 0 1
    > 0 0
    > 1 1
    > 1 2
    > 0 1
    >
    >
    >
    >




  4. #4
    OldKenGoat
    Guest

    Re: How do I increment or decrement values in a column?

    Thanks, Niek. It worked perfectly!!!

    Niek Otten wrote:
    > In B2:
    >
    > =B1+(IF(A2=0,-1,1))
    >
    > Fill down
    >
    >
    > "OldKenGoat" <[email protected]> wrote in message
    > news:[email protected]...
    >> I have a column of the numbers 1 and 0. In an adjacent column, I
    >> want to increment or decrement the value by 1. I know there's a
    >> simple way to do this, but, I can't see it! Thanks for any help,
    >> OldKenGoat Example:
    >> Col A Col B
    >> 0 0
    >> 1 1
    >> 1 2
    >> 1 3
    >> 0 2
    >> 1 3
    >> 1 4
    >> 0 3
    >> 0 2
    >> 0 1
    >> 0 0
    >> 1 1
    >> 1 2
    >> 0 1





+ 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