How to count the nth set of 6 numbers (repeated 6 numbers based on another column)

feni1388

Board Regular
Joined
Feb 19, 2018
Messages
129
Office Version
  1. 2021
Platform
  1. Windows
Hello everyone...

I have a data that I need to upload to customer's web system.
In their system, we are only allowed to load 6 rows for each Invoice no.
If the rows are more than 6, it has to start from no. 1 again and the invoice no. has to change sequentially.
I thought if I can know/count the nth set of the 6th numbers, then I can change the invoice no.
But I'm stuck on how to count the nth set of the 6th number.

Does anyone have any ideas how to achieve this?

What I have now.

Book1
ABCDEFGHI
1Inv no.売上日Delivery dateDelivery timeOrder No.Customer codeRowtotal row of the same order no.The nth set
2123456
38816072024/7/112024/7/12AM907756HKB01000191
48816072024/7/112024/7/12AM907756HKB01000291
58816072024/7/112024/7/12AM907756HKB01000391
68816072024/7/112024/7/12AM907756HKB01000491
78816072024/7/112024/7/12AM907756HKB01000591
88816072024/7/112024/7/12AM907756HKB01000691
98816072024/7/112024/7/12AM907756HKB01000192
108816072024/7/112024/7/12AM907756HKB01000291
118816072024/7/112024/7/12AM907756HKB01000392
Sheet1
Cell Formulas
RangeFormula
G3:G11G3=IF(OR(G2="",G2=6,E3<>E2),1,G2+1)
H3:H11H3=COUNTIF(E:E,E3)
I3:I11I3=IF(AND(H3>6,G3<=6,E3=E4,G3<>1),1,I2+1)


What I want to achieve.

Book1
ABCDEFGHI
1Inv no.売上日Delivery dateDelivery timeOrder No.Customer codeRowtotal row of the same order no.The nth set
2123456
38816072024/7/112024/7/12AM907756HKB010001171
48816072024/7/112024/7/12AM907756HKB010002171
58816072024/7/112024/7/12AM907756HKB010003171
68816072024/7/112024/7/12AM907756HKB010004171
78816072024/7/112024/7/12AM907756HKB010005171
88816072024/7/112024/7/12AM907756HKB010006171
9881607-22024/7/112024/7/12AM907756HKB010001172
10881607-22024/7/112024/7/12AM907756HKB010002172
11881607-22024/7/112024/7/12AM907756HKB010003172
12881607-22024/7/112024/7/12AM907756HKB010004172
13881607-22024/7/112024/7/12AM907756HKB010005172
14881607-22024/7/112024/7/12AM907756HKB010006172
15881607-32024/7/112024/7/12AM907756HKB010001173
16881607-32024/7/112024/7/12AM907756HKB010002173
17881607-32024/7/112024/7/12AM907756HKB010003173
18881607-32024/7/112024/7/12AM907756HKB010004173
19881607-32024/7/112024/7/12AM907756HKB010005173
Sheet1
Cell Formulas
RangeFormula
G3:G19G3=IF(OR(G2="",G2=6,E3<>E2),1,G2+1)
H3:H19H3=COUNTIF(E:E,E3)
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
In I3, try:
Excel Formula:
=ROUNDUP(COUNTIF($E$3:E3,E3)/6,0)
 
Upvote 0
Solution

Forum statistics

Threads
1,223,164
Messages
6,170,435
Members
452,326
Latest member
johnshaji

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