Increment a number untill N set in another cell and reset : Formula help plz.

jbesclapez

Active Member
Joined
Feb 6, 2010
Messages
275
Hi MrExcel,

I have a table like this :
GroupIncrement
11
11
11
11
21
22
21
22
21
22
31
32
33
41
42
43
44
41
42
43
44
51
52
53
54
55

<tbody>
</tbody>


Basically a group is in the first column.
Group one means there is only one data so I start at one and do not increment in the right column
Group 2 means there are 2 numbers so in the right column I start at one, then add one and reset... untill I reach a new group.
Group 3 means there are 3 number so in the right column I start at one, then 2 then 3 and I reset... untill the group is finished.

I tried without success this formula :=IF(MOD(ROW(), H3486) = 0, 1,MOD(ROW(), H3486)+1)

How would i do that?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
try this:



Book1
B
21
Sheet4
Cell Formulas
RangeFormula
B2=MOD(ROW() - MATCH(A2,$A$2:$A$27,0) - 1, A2 ) + 1





Book1
AB
1Group
211
311
411
511
621
722
821
922
1021
1122
1231
1332
1433
1541
1642
1743
1844
1941
2042
2143
2244
2351
2452
2553
2654
2755
Sheet4
 
Upvote 0
try this:


B
21

<colgroup><col style="width: 25pxpx"><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet4

Worksheet Formulas
CellFormula
B2=MOD( ROW() - MATCH(A2,$A$2:$A$27,0) - 1, A2 ) + 1

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>





AB
1Group
211
311
411
511
621
722
821
922
1021
1122
1231
1332
1433
1541
1642
1743
1844
1941
2042
2143
2244
2351
2452
2553
2654
2755

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet4

Thanks for your time :)

This formule uses a fix array from A2 to A27. I would like it to be "dynamic".

I changed your formula to that :
=MOD( ROW() - MATCH(H2,H:H,0) - 1, H2 ) + 1

but it is not working as expected on the group 2 it starts with a 2 instead of a 1
 
Upvote 0

Forum statistics

Threads
1,215,338
Messages
6,124,358
Members
449,155
Latest member
ravioli44

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