Automatically restart formula given that parameter is met?

singhm

New Member
Joined
Feb 26, 2016
Messages
2
Hi Experts,

I am in need of some assistance. I have a list of multiple id's in column A, column b contains data of the number of items linked to the ID. I want to generate a list of every page pertaining to each ID as follows, so i want in column C (for example) "a - Page 0001" all the way until "a - 1000" given that a had 1000 pages but then when it reaches 1000, i want it to restart from b as follows:

[TABLE="width: 481"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]a[/TD]
[TD]1000[/TD]
[TD]a - Page 0001[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]2000[/TD]
[TD]a - Page 0002[/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]1500[/TD]
[TD]a - Page 0003[/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]1200[/TD]
[TD]a - Page 0004[/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD]700[/TD]
[TD]…[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]a - Page 1000[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]b - Page 0001[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]b - Page 0002[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]b - Page 0003
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]b - Page 0004
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]…
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]b - Page 2000[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]c - Page 0001
[/TD]
[/TR]
</tbody>[/TABLE]

I have tried using the following formula:

=IF(ROW(C1)< B1+1,CONCATENATE($A$1," - Page ",TEXT(ROW(C1),"0000"),""))

The problem is that once it reaches 1000 i get errors (#VALUE!), firstly, I believe i have to $ the &A$1 otherwise when i drag the formula down it will just refer to the column to the left an i'll get a - Page 0001, b - page 0002, etc. Secondly, i am using the ROW function in order to generate the page numbers but i dont understand how i can force it to restart from 1 once it reaches the maximum (i.e 1000 for a).

I hope you can help.

Kind regards,
Manpaal Singh
 
Last edited by a moderator:

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,223,099
Messages
6,170,111
Members
452,302
Latest member
TaMere

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