Formula to change the ref number in a coulmn once all of them have been used

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,
Hope you can help with this,

I am trying to make a list of products,
the formula I need is this

I have my products in batch numbers from 1 on
I need to make a list of this batch numbers but miss out the numbers that have zero products at the moment

So for example
In Sheets " Product"
Column B is the batch numbers (Not in order)
Column C is the number of products that need that batch number

so Sheets Data Column A cell A3= 1 (there will always be at lest one item in batch 1)
So Cell A4 need to Count how many number 1 there are above it, and look batch 1 in sheets Product column B and see how many number ones there are,
if its more than we have then its still batch 1,
but if its equal we need to go to the next batch number with items so if batch 2 column C = a number then its batch 2 but if its a zero we need to miss it, but also if c is zero and so on?

i'll try do a small chart

Sheet Products
A
B
C
D
E
F
Batch Number
Number of rows needed
73
4
3
1
3
2
5
5
0
9
4
8
0
6
0
3
0
Data sheet
What I need
Batch number
1
so because Column C shows batch 1 as needing 3 rows we get 3 rows of 1
1
1
2
same
2
2
2
2
4
but here 3 was zero so its missed
4
4
7
so was 5 and 6
7
7
9
and 8
9
9
9
Please help if you can

<tbody>
</tbody>
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
This is more of a job for VBA than a formula.
I;m not a VBA expert, hopefully someone will come along and solve it.
 
Upvote 0
(there will always be at lest one item in batch 1)
In that case, try this. You should be able to adapt to work on two sheets if it is what you want.

A13 houses a 1
A14 is copied down.

Excel Workbook
ABC
1BatchRows
273
343
413
525
650
794
880
960
1030
11
12
131
141
151
162
172
182
192
202
214
224
234
247
257
267
279
289
299
309
31
Batch Numbers
 
Last edited:
Upvote 0
I just realised that the formula in my previous post did not display correctly. I have edited it to do so now.
Not sure if you were able to work out what I had meant to post.
 
Last edited:
Upvote 0
Hi Peter,
thank you for the correction, I had already spoted it and was able to change it, sometimes all I need is the push in the right direction, but thank you for all your help
Tony
 
Upvote 0

Forum statistics

Threads
1,215,005
Messages
6,122,661
Members
449,091
Latest member
peppernaut

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