Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
COSdl
 
Posts: n/a
Default Increment a counter in Excel

How can I increment a counter in a worksheet cell from the value entered in
other cellsl? For instance if the value in cell A2 = true I want to replace
the value in B2 with the value in A1(the counter), then increment the value
in A1 by 1. The worksheet might look like this:
A B
1 4
2 TRUE 1
3 FALSE
4 TRUE 2
5 TRUE 3
6
7
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

Try this:

1. Copy this into A1:

=COUNT(B:B)

2. Copy this into B2 and fill down the column as far as
you think you'll need it:

=IF(A2="","",IF(A2,MAX($B$1:B1)+1,""))

3. Star filling in col. B with TRUE/FALSE

HTH
Jason
Atlanta, GA

-----Original Message-----
How can I increment a counter in a worksheet cell from

the value entered in
other cellsl? For instance if the value in cell A2 =

true I want to replace
the value in B2 with the value in A1(the counter), then

increment the value
in A1 by 1. The worksheet might look like this:
A B
1 4
2 TRUE 1
3 FALSE
4 TRUE 2
5 TRUE 3
6
7
.

  #3   Report Post  
COSdl
 
Posts: n/a
Default

Thanks, Jason. This is almost it! I also need to increment the counter in
A1 (which will actually be on another spreadsheet. Each sheet will use the
counter on sheet!A1. I am assigning a number to each "true" which could be
on multiple sheets. Also, I think you meant for your #3. instruction to be
"Start filling in col. A" rather than col. B???? This is what my spread sheet
looks like now:
A B
1 0
2 TRUE 1
3 TRUE 2
4 TRUE 3
5 TRUE 4
6 TRUE 5
7 TRUE 6
8 TRUE 7
9 FALSE
10 TRUE 8
11 FALSE
12 TRUE 9
13 FALSE


"Jason Morin" wrote:

Try this:

1. Copy this into A1:

=COUNT(B:B)

2. Copy this into B2 and fill down the column as far as
you think you'll need it:

=IF(A2="","",IF(A2,MAX($B$1:B1)+1,""))

3. Star filling in col. B with TRUE/FALSE

HTH
Jason
Atlanta, GA

-----Original Message-----
How can I increment a counter in a worksheet cell from

the value entered in
other cellsl? For instance if the value in cell A2 =

true I want to replace
the value in B2 with the value in A1(the counter), then

increment the value
in A1 by 1. The worksheet might look like this:
A B
1 4
2 TRUE 1
3 FALSE
4 TRUE 2
5 TRUE 3
6
7
.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I get a program error when I download an excel template Ladybug Excel Discussion (Misc queries) 3 March 4th 05 01:02 AM
html to excel nellie Excel Discussion (Misc queries) 4 February 8th 05 11:37 PM
Merge from Excel to Excel dalstar Excel Discussion (Misc queries) 3 January 30th 05 03:37 PM
How do I auto increment cell value on print in Excel Hiren Excel Worksheet Functions 7 January 25th 05 07:39 PM
Shortcut file fails to open JimH Excel Discussion (Misc queries) 3 January 15th 05 11:13 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"