need help to write a vba code to determine materials required to meet 30 days of stock

Copper Contributor

need an excel formula or macro vba code to auto calculate the "Requirement" to keep the days of stock at at least 30 days. For example, if the "days of stock" in july is >= 30 days then the "requirement" in june is 0 however if the "Days of Stock" is < 30 then the "requirement" in june should generate the material required to keep it at 30

4 Replies

@coreylameen19 

Can you use this formula?

=IF(daysstock>=30,0,(30-daysstock))

= Requirement

i already tried that but it didnt work. because there is a circular reference to its self
Can you attach an example spreadsheet?
i have attached the sample spreadsheet