View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Major help needed - Iterative Functions

I'm think a more structure apporach would work better. I've been thinking about the optimum
'algortihm' that you would use - start with the first full cycle:

A1 B1 A2 B2 C1 A3 C2 B3

the first "cycle" would be A1 B1. So start with B1, and work backward to A1. Then ask - can I fit
in all of A2, A3, ... Ax in the slack time? If so, do pick the largest of the A2 to Ax lots that
will fit, and do so. If not, can you fit in any of B2, B3, .... Bx? and so on.

But if none of the whole lots fit (the answer to all of those questions are "No"), then move both A1
and B1 to the earliset times, and then go onto the next cycle A2, B2, and C1, and apply the same
logic, with the exception that the first question is: can I fit in one of the B2... Bx first, since
the machine is set up for B already, without affecting A?

HTH,
Bernie
MS Excel MVP


"LiAD" wrote in message
...
I can do the working backwards bit. Its producing the final improved version
that I am getting stuck on - apparently its not easy either! At least that
re-assures me a bit.

If producing the final schedule cannot be automated on excel then such is
life.

I will try the random approach and see what that yields in the meantime -
something close might be better than the nothing I have now.

Thanks

"Bernie Deitrick" wrote:

LD,

The best approach to this problem is to use a bit of common sense, and to work backwards from
required date/times. It is way too complicated to program in a simple macro.

For each of your unique products, find the earliest due date. Then work from the latest unique
product backwards, like in this made up example:

Say you need 40 A on April 4, 50 B by April 5, and 60 C by April 6, and all must be shipped by
Noon
on the due date. And then you need 30 A on April 9, 45 B by April 10, and 90 C by April 11.

Start at Noon on April 6, and calculate when you need to start work on the 60 Cs to finish by
then,
including change-over time. If that start time is later than the B's are due, leave the time
between the two unassigned, and then do the same for the 50 Bs. Again, if B's start time is
after
the As are due, leave that time unassigned, and do the same for the 40 As. That gives you your
absolute latest start time for each product. Then, you need to decide what to do with the
intermediate times. You can move up or expand production of A to include the next 30 units, in
the
time before A needs to start, or into the time after A is due and before B needs to start. You
can
move up production of the first 40 A, keeping the production the same, and expand Bs production
to
include the extra 45 B, and so on.

But the decision on how to move things around will depend on a lot of things, especially future
volumes. If the slack time in the first cycle would allow you to produce all of the A needed in
a
future cycle, then move that production of A up, and you will save the switch-over time
associated
with that batch. Basically, you are trying to fit blocks of production into the schedule in such
a
way that you remove the need for the change-over, and that requires judgment, something that
Excel
is famously bad at.

HTH,
Bernie
MS Excel MVP


"LiAD" wrote in message
...
Just made a quick calculation to see if this is possible.

My production schedule will be 40-80 lines long. 80! = a huge number, a lot
more than the 65000 lines thats in excel meaning I would not have space to
generate every possible version of the table.

Would there be a way of excel just outputting an optimised solution?

Thanks
LD

"joel" wrote:

I don't have any idea on the quantities or time to make each item so it is
hard to get to a correct solution. A JIT approach would require finding the
latest date to start an order and the time required to make the item.

to try evvery combination would requir e chaing the which orderr you build
first, then 2nd and thrid going though every combination or build sequencies.
if you had 10 orders then try each combination

Below is a table of the orders and the sequence built. the 1st row is
building the order in sequence. The 2nd row is the same except building
order 10 before order 9.
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
1, 2, 3, 4, 5, 6, 7, 8, 10, 9
1, 2, 3, 4, 5, 6, 7, 9, 8, 10
1, 2, 3, 4, 5, 6, 7, 9, 10, 8
1, 2, 3, 4, 5, 6, 7, 10, 8, 9
1, 2, 3, 4, 5, 6, 7, 10, 9, 8
1, 2, 3, 4, 5, 6, 8, 7, 9, 10
1, 2, 3, 4, 5, 6, 8, 7, 10, 9
and so on

the solution would be to try every combination and determine how many orders
were late, the number of times you had to retool, and the number of days you
shipped before the due date.

"LiAD" wrote:

To take ur points one at a time. Assume that

- inventory is zero it all needs to be manufactured.
- manufacturing can start at today()
- prod is 24 hours mon-fri
- in reality the product range is massive so its more or less custom orders.
reoccuring orders will be dealt with another way. This tool does not need
to take care of those orders.
- Rather than picking a number of days between retools I would rather than
excel told me when i had too. When I have to could be based on your JIT
approach, perfect. Dates will decide when products will be scheduled.
- no penalties or cost analysis needed just balance what we need to produce
against optimising machine running time.

I could start with the most urgent product. Ask excel to find all products
that are the same as the urgent product, schedule them all together, then
just before the next product will be late schedule a change and so it
continues. Nice approach and i think that would work for this case.

In terms of developing a macro to run this - at the moment thats beyond my
knowledge.

What do you mean by keep and history and the best results? Lots of
schedules are produced and you just pick the best one?

I know details are a bit vague for now, but once i see if the approach may
work then I can put some fat on the bones.

Thanks a lot for your help
LiAD

"joel" wrote:

The problem can be sove with programming but you need some additional
information to get started. First how much inventory do you have and does
your delivery dates start immediatel or do you have some lead time? Also how
many hours a day are you working and is there any penaties for working over
time?

The solution for the problem is to set up some criteria(s) whre you are
going to retool and then compare the results to determine the best solution.
The best solution would be to minimze being late and to build up as much
inventory as possible. One questtion you didn't specify is if each order is
a custom order or are there standard products. Each product could come in
100 different colors so you wouldn't be able to build up inventory, every
order is a custom order.

One soilution could be to change products every two days. Another solution
would be to continue making one product until you wold become late on one of
the other two products and switch so you are making a product "Just-In-time".

This problem seems like a modeling solution is the best approach. In
modeling your run a 1000 (or any fixed number) of attempts. Set criteria X =
number of days until you retool (make number 1 to 10) and Y when you retool
which product you change to (could be the same product. then keep a history
of the results keeping only the best results.


for i = 1 to 1000
X= int(10*rnd())+1
Y= int(3*rnd())+1 product A = 1 Product B = 2 Product C = 3

for Days = 1 to 100
'run your production line and vaidate if you met your criteria

next Days

next i

Hello,

I have a complicated problem which is dificult to explain easily I think.
I will try and lay out the basic concept. What I would like to know is how
can I achieve this in excel.

I have a list of products A B C for example which I will produce during a
set period of gg days on one single machine. The knowns are
- It takes xx hours to produce A, yy for B, zz for C
- If I change from one product to another it takes 4 hours to retool the
machine (from A to B, B to C etc for all changes)
- The production date that each product must be finished

Customers, (being difficult), would like me to deliver in the following
order A B C A C A C B. This presents two potential problems
- Time may be restricted
- If I do follow the customers orders exactly I need to spend a lot of time
changing over my machine. Time wasted that maybe I can use to find more
products or customers.

What would be nice is to have a tool in excel that can answer the question -
can I change the order in which I will manufacture the products and still
meet the customer delivery requirements? If so give me a production schedule.

So I have a table from which I know the products and dates the customer
wants. From the production and tool change times required I can calculate
when it will be possible to make each product. Then I would like to find
some way to get excel to produce a production schedule by optimising the
manufacturing order to reduce the amount of tool changes, (and therefore
total time spent on them), ensuring that all of my orders respect the
customer dates.

The function/method needs to group similar products together providing
- manufacture is finished on or before the customer date
- the resort process does not make any other products late (as in if the
customer asks to have A B A but I re-organise to A A B maybe the A's are
great but I have made the B late).

An important point to consider is that I have only one machine therefore it
is one product after another so the time that product 2 is finsihed is time
of day the line was started + manufacture time for product 1 + tool change
time + time to make product 2.

The function, (in my opinion), needs to iterative as basically it will
re-organise the manufacturing order, check that all orders will be finished
within date, if not re-organise and recheck etc etc.

Is this possible and if so how in terms of function design etc?

Thanks a lot. I hope its clear enough, if not please ask. I'll well stuck
in tables and tables and tables.

LiAD