Formula for calculations using dates under certain conditions

JennyG

New Member
Joined
Aug 21, 2014
Messages
2
Hi
I'm trying to build a spreadsheet that will be able to calculate current stock levels by taking into account what the last action was (e.g. stocktake, purchase, order), etc but I don't know how to write formulas that will do what I need them to do.

Any data from before the stocktake doesn't need to be taken into account, but if we've done a stocktake and then there have been orders or sales since then, I need that to be picked up.

So, if the most recent action was a stocktake (and the date in E2 was the most recent date), then B4=E4 (data is listed below dates starting from cell 4).

But if we've done a stocktake and then an order in or sale out, it will need to be B4=E4+C4-D4

Is it possible to even do this??
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi,

With Excel you can certainly do it ...
First, list all possible events and build the respective individual formulas...
Then, you will design the user interface, probably with data validation...

HTH
 
Upvote 0
Hi,

With Excel you can certainly do it ...
First, list all possible events and build the respective individual formulas...
Then, you will design the user interface, probably with data validation...

HTH

Thanks. By "build the respective individual formulas", do you mean figure out all the possible "if date X is before date Y, then" stuff?

And how do you do those formulas?

Thanks
 
Upvote 0
Hi Jenny,

In Excel, dates are numbers ... so if you want to compare two dates located in cells A3 and A2, just go ahead with:
Code:
=If(A3>A2,"Later","Earlier")

HTH
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,078
Latest member
skydd

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