ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add one to Column numbers (https://www.excelbanter.com/excel-programming/426137-add-one-column-numbers.html)

C

Add one to Column numbers
 
I have a spreadsheet that I need to increment Column X by one on a monthly
basis. When Column x = 12 then it goes back to 0 and column w is is
incremented by one.

Example:

March 2009
Column W Column X
10 11

April 2009 After Calculation
Column W Column X
11 0

May 2009 After Calculation
Column W Column X
11 1

Can someone give advice on how to best accomplish this?

Thanks in advance.
CB


Joakim Norrman[_2_]

Add one to Column numbers
 
Cell X1:
=IF(MONTH(TODAY())+8<12;MONTH(TODAY())+8;MONTH(TOD AY())-12)

Cell W1:
=IF(X1=1;X1-1;X1+11)

Then you can drag formula in W1 to column V, U, T, S ... (If wanted)


"C" wrote:

I have a spreadsheet that I need to increment Column X by one on a monthly
basis. When Column x = 12 then it goes back to 0 and column w is is
incremented by one.

Example:

March 2009
Column W Column X
10 11

April 2009 After Calculation
Column W Column X
11 0

May 2009 After Calculation
Column W Column X
11 1

Can someone give advice on how to best accomplish this?

Thanks in advance.
CB


Joakim Norrman[_2_]

Add one to Column numbers
 
Sorry, I think the reference cell X1 shall be:
=IF(MONTH(TODAY())+8<12;MONTH(TODAY())+8;MONTH(TOD AY())-4)

"Joakim Norrman" wrote:

Cell X1:
=IF(MONTH(TODAY())+8<12;MONTH(TODAY())+8;MONTH(TOD AY())-12)

Cell W1:
=IF(X1=1;X1-1;X1+11)

Then you can drag formula in W1 to column V, U, T, S ... (If wanted)


"C" wrote:

I have a spreadsheet that I need to increment Column X by one on a monthly
basis. When Column x = 12 then it goes back to 0 and column w is is
incremented by one.

Example:

March 2009
Column W Column X
10 11

April 2009 After Calculation
Column W Column X
11 0

May 2009 After Calculation
Column W Column X
11 1

Can someone give advice on how to best accomplish this?

Thanks in advance.
CB


C

Add one to Column numbers
 
Joakim,

Thanks for the responses, however I can't seem to get any of these to work
for me. You are correct that the X value represents months. This month
however has nothing to do with current date.

The spreadsheet holds personnell information and I just need to update this
once a month adding 1 to the X column. When the X column value equals 12 it
should reset to 0 and column w should return the current value + 1.

Can this be done thru VBA?

Thanks,
C

"Joakim Norrman" wrote:

Sorry, I think the reference cell X1 shall be:
=IF(MONTH(TODAY())+8<12;MONTH(TODAY())+8;MONTH(TOD AY())-4)

"Joakim Norrman" wrote:

Cell X1:
=IF(MONTH(TODAY())+8<12;MONTH(TODAY())+8;MONTH(TOD AY())-12)

Cell W1:
=IF(X1=1;X1-1;X1+11)

Then you can drag formula in W1 to column V, U, T, S ... (If wanted)


"C" wrote:

I have a spreadsheet that I need to increment Column X by one on a monthly
basis. When Column x = 12 then it goes back to 0 and column w is is
incremented by one.

Example:

March 2009
Column W Column X
10 11

April 2009 After Calculation
Column W Column X
11 0

May 2009 After Calculation
Column W Column X
11 1

Can someone give advice on how to best accomplish this?

Thanks in advance.
CB



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

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