How to Number Rows Every 1000 - excel

How can I autonumber for every 1000 rows? without using macros.
I am trying to divide/batch 100k records for every 1000. And i figured creating batches and autonumbering them is a start.
Row1
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
2 1
2 2
2 3
2 4
2 5
2 6
2 7
2 8
3 1
3 2
3 3
3 4
3 5
3 6
3 7
3 8

In A1 enter:
=ROUNDUP(ROW()/8,0)
and copy down. In B1 enter:
=MOD(ROW()-1,8)+1
and copy down:

You type the first and second rows as 1 and 2 and then highlighting them and dragging from the little square at the bottom right of the selection will autofill with sequential numbers (ie 1, 2, 3, 4). Once you get to 1000 you can copy and paste the whole column up to that point at the bottom. Pasting 99 times should provide you with what you are requesting. Cheers.

MOD(dividend, divisor)
https://support.google.com/docs/table/25273?hl=en
Use that function with 1000 as the divisor. That should work

Related

How to multiple column join in one column in excel (I Want Formula)

HOW TO JOIN MULTIPLE COLUMN IN ONE COLUMN
TABLE 1 TABLE 2 TABLE 3
1 2 5
2 4 3
3 5 3
4 5 1
I WANT TO
1
2
3
4
2
4
5
5
5
3
3
1
If your data is like below, enter the formula in the first row of any column and drag down until there is no value left over,
=IF(ROW()<=COUNTA(A:A),INDEX(A:A,ROW()),IF(ROW()<=COUNTA(A:B),INDEX(B:B,ROW()-COUNTA(A:A)),IF(ROW()>COUNTA(A:C),"",INDEX(C:C,ROW()-COUNTA(A:B)))))

find number appears more

1 2 2
4 5 4
3 3 3
0 1 0
1 2 2
4 4 3
4 5 4
4 5 4
3 4 4
3 4 4
4 4 4
3 4 3
I have above three columns in excel,how to find the number that appears more times, for example, first row is 2 (because it has two 2 and one 1)
Assuming your layout is such that the first column is A, second column is B, etc., then you could put the following in cell D1:
=IF(ISNUMBER(MODE(A1:C1)),MODE(A1:C1),0)
This also outputs 0 in case there is a tie. You can replace the 0 with whatever excel expression you want if you don't want ties to result in a 0.

Data fill in specific pattern

I am trying to fill data in MS Excel. I am given following pattern:
1 2
1
1
2 5
2 5
2
3
3 6
3
4
4
5 4
And I want my output in following format:
1 2
1 2
1 2
2 5
2 5
2 5
3 6
3 6
3 6
4
4
5 4
I tried using if(b2,b2,c1) in column 3. but that doesn't solve the problem for a=3 and a=4.
Any idea how to do this in Excel?
With sorting thus:
(the effect of which in this case is merely to move 6 up once cell) and a blank row above:
=IF(AND(A2<>A1,B2=""),"",IF(B2<>"",B2,C1))
In C2 and copied down should get the result you ask for from the data sample provided.

Dynamically determining range to apply formula/function in EXCEL

I need to determine the range to apply the Frequency function. Here's what the problem is. On the given sheet, I have subtotals for my data and there is a column which has "Stop" Values.
The data would look something like:
Route1
Order# Stop# Qty
001016 1 5
008912 1 5
062232 2 6
062232 3 2
069930 4 1
1000 4 3
1001 4 4
1001 5 8
1003 8 1
Route 1 Subtotal 6 35
Route2
Order# Stop# Qty
10065 1 5
10076 1 5
10077 2 6
10079 3 2
10087 4 1
10098 4 3
10109 4 4
10171 5 8
10175 8 1
Route 2 Subtotal 6 35
How do I write VBA code for calculating the distinct stop values. I need the distinct count of the stop#. Hence in the example above you can see that the total stops are 6 because 1 stop can have multiple orders and 1 route can have multiple orders/stop. Hope I am making sense here. Let me know how I would write my VBA code for this. Thanks for your help.
For the Stop Subtotal unique count, try this formula (adjust ranges as required):
=COUNT(1/FREQUENCY(B2:B10,B2:B10))

Giving duplicates in Excel a unique identifier

I have a large excel spreadsheet containing multiple address lines. Many of these adress lines contain duplicate postcodes, with differing steet adrresses.
I need to seperate out each of these duplicates onto different spreadhseets, so that no one spreadhseet contains the same postcode. I'm currently using an =if() statement to identify the duplicates, then cutting and poasting, and repeating almost ad infinitum to speperate them all out
as an example:
address 1 postcode 1
address 2 postcode 1
address 3 postcode 1
address 4 postcode 2
address 5 postcode 2
address 6 postcode 3
address 7 postcode 3
address 8 postcode 3
address 9 postcode 3
would give 4 spreadsheets:
1)
address 1 postcode 1
address 4 postcode 2
address 6 postcode 3
2)
address 2 postcode 1
address 5 postcode 2
address 7 postcode 3
etc
Any hints on a vb script?
Many thanks
Nick
If this is a one-off thing, then I'd consider doing it in the worksheet and bulk cut-pasting. I'd try something like this:
Sort my data on the post code column
In a new column, add a function to count the number of post codes below the current row that are duplicates of the code on that row (see below)
Save (copy/paste-special-values) the values obtained
Sort by duplicate number
Cut and paste blocks by duplicate number to new sheets
Say I have 20 values between 1 and 5 in column G. I put the following formula in H1:
=SUM(IF(G1:$G$20=G1,1,0))
... and (important bit) enter it as an array formula using Control+Shift+Enter. Now I copy that formula down (for speed, double-click the "fill handle" on the bottom right-hand corner of the cell). Here's my result:
1 2
1 1
2 2
2 1
3 8
3 7
3 6
3 5
3 4
3 3
3 2
3 1
4 2
4 1
5 6
5 5
5 4
5 3
5 2
5 1
Now I can copy column H and Edit...Paste Special...Values to fix the values. Sort by H to get this:
1 1
2 1
3 1
4 1
5 1
1 2
2 2
3 2
4 2
5 2
3 3
5 3
3 4
5 4
3 5
5 5
3 6
5 6
3 7
3 8
Now I have sets of records to copy to each of the 8 sheets that I now know are needed.
Of course, if you're going to be doing this a lot, then a macro would be useful. It needn't be much more complex than automating the above.

Resources