ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   How do I increment or decrement values in a column? (https://www.excelbanter.com/new-users-excel/4787-how-do-i-increment-decrement-values-column.html)

OldKenGoat

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





Niek Otten

In B2:

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

Fill down

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"OldKenGoat" wrote in message
...
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







Bob Phillips

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" wrote in message
...
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







OldKenGoat

Thanks, Niek. It worked perfectly!!!

Niek Otten wrote:
In B2:

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

Fill down


"OldKenGoat" wrote in message
...
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






All times are GMT +1. The time now is 12:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com