Need to increment untill another value is found

Stiino0

New Member
Joined
Feb 19, 2014
Messages
12
Hello all,

Just new to the site but have been lurking posts for a long time now, really helpful stuff.

Here's my problem (I want it in a formula/macro):

I want to increment a value in a certain column B for example untill infinity or untill the value of column A changes. And then the value should restart at 1 (value can be text all of a sudden ex. 11A, 15A, 15B,...)

so example:

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]

I want to make it automated to that I can easily use a formula/macro to make +600 articles instantly correct.

Thanks in advance for any kind of help! If anymore info is needed, I'll be lurking my own post! :)

Kind regards,

Stiino0
 
Last edited:

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
If you want to, can you explain how the formula works? Then I can implement it in other excel sheets as well. Wow love the support on this website
 
Upvote 0
Sure, row(a1) is the counter that will increase by one with each row, so the formula knows to start with whatever term you have first, then count occurences within the cumulative range (notice the absence of dollar signs extends the range by one at each row increment). Since it's not counting below the current cell, you will have 1 for each new term, 2, etc until a new one appears.
 
Upvote 0
If you want to, can you explain how the formula works? Then I can implement it in other excel sheets as well. Wow love the support on this website
Very good stuff, thanks! I love to formulas more than macroes but I think more can be done with macroes right?
 
Upvote 0
Hi all,

The formula worked a year ago but after all the models that needed to be done were finished, I abandoned the formula... Now that I'm trying to revive it I can't seem to get it right again?! I always end up with a "new pagenumber" on my last page (where it should still continue to calculate the last page)

Unfortunately for me, the upload that I did a year ago isn't available anymore so I'll try to send a new one... Hope you guys are willing to do the same thing again... :)

Here's the file everything needs to come in column C for this example.

Thanks in advance! (again :( )

Kind regards,

Stiino0
 
Upvote 0
Plz halp :(

Greatly appreciated and will be documented better... My bad :'(

Thanks in advance!

Kind regards,

Stiino0
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top