Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-21-2014, 04:23 PM
ImAhNoBoDy ImAhNoBoDy is offline Adding quantity if statement Windows 7 64bit Adding quantity if statement Office 2007
Novice
Adding quantity if statement
 
Join Date: Jan 2012
Posts: 9
ImAhNoBoDy is on a distinguished road
Default Adding quantity if statement

I'm trying to calculate if an item will still be in stock when used in a certain amount during the week or if I need to buy them and by how much.

Current I have this set up:

A1=18
A2=5



A1 is 18 eggs per box and A2 is the quantity used. My formula is:

=IF(A1-A2*7<=5,"BUY","IN STOCK")

The 7 is from 7 days/week. I want the "BUY" part to look something like: "BUY=1" if it's lower than A2.

Thanks if you can help.
Reply With Quote
  #2  
Old 06-22-2014, 05:58 AM
BobBridges's Avatar
BobBridges BobBridges is offline Adding quantity if statement Windows 7 64bit Adding quantity if statement Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Nobody, I thought I understood this but as I got into the details I decided I need to ask questions first. What would make sense to me is if you have, or want, a worksheet like this:
Code:
      A               B         C          D        E      
1 Description      In stock   Status    Used/day  8 days
2 Butter, lb          28     IN STOCK       3       24
3 Milk, gallon        23     BUY=25         6       48
4 Eggs, 18/carton     12     BUY=28         5       40
5 Sour cream, lb      13     IN STOCK       1        8
With this arrangement (which is what I suspect you're building toward though you haven't spelled it out), you can put in column D how much you figure you sell every day. Column E has a formula "=Dn*8" which calculates how much you should have in stock so as to have one day's stock left over by reorder time next week. (You don't want to have five left over for every item; you want to have more left over of the items that sell faster, right?)

If so, then the formula for column C would look like this:
Code:
=IF(Bn<En,"BUY="&En-Bn,"IN STOCK")
But I made a lot of guesses while I was trying to fill in the blanks in my understanding; I may have filled them in completely wrong.
Reply With Quote
  #3  
Old 06-22-2014, 08:01 AM
ImAhNoBoDy ImAhNoBoDy is offline Adding quantity if statement Windows 7 64bit Adding quantity if statement Office 2007
Novice
Adding quantity if statement
 
Join Date: Jan 2012
Posts: 9
ImAhNoBoDy is on a distinguished road
Default

BobBridges, I confused myself too, haha. Let's make your description measurements smaller, so I don't confuse you or me. Let's say currently in stock:

Butter has 28 tbsp/box. If 1 box=32 tbsp.
Milk has 23 .5 cups/gallon. If 1 gallon=32 .5 cups.
Eggs has 12 eggs/carton. If 1 carton=18 eggs.

In your example, I will need an to see how many cartons of eggs I need to buy. If calculated correctly, I will need to buy 2 cartons of eggs for the week if I use 5/day with a current stock of 12 eggs. So the cell should say BUY=2.

I'm only calculating from a full box, gallon, carton, etc only. So when calculated in the beginning, I wouldn't have an "in stock" column, but a current full box column.

Hopefully that clears things up.

Edit: I think I got it to work

=IF(Bn<=En*7,"BUY="&ROUNDUP(SUM(SUM(En*7)-Bn)/En,0)),"IN STOCK"))

Last edited by ImAhNoBoDy; 06-23-2014 at 05:04 AM.
Reply With Quote
  #4  
Old 06-23-2014, 05:13 AM
BobBridges's Avatar
BobBridges BobBridges is offline Adding quantity if statement Windows 7 64bit Adding quantity if statement Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Quote:
=IF(Bn<=En*7,"BUY="&ROUNDUP(SUM(SUM(En*7)-Bn)/En,0)),"IN STOCK"))
If that works for you, ok (I have a ton of stuff to do today so I won't try too hard to check), but you don't need the SUM functions there. The same thing happens without them:
Code:
=IF(Bn<=En*7,"BUY="&ROUNDUP((En*7-Bn)/En,0)),"IN STOCK"))
No, wait, there's a problem here. In column E, I have eight days' supply already. The whole point of doing that is not to have to repeat the multiplication in the IF function. If you don't want to have the extra column E, then you multiply by D instead.
Reply With Quote
  #5  
Old 06-23-2014, 01:16 PM
ImAhNoBoDy ImAhNoBoDy is offline Adding quantity if statement Windows 7 64bit Adding quantity if statement Office 2007
Novice
Adding quantity if statement
 
Join Date: Jan 2012
Posts: 9
ImAhNoBoDy is on a distinguished road
Default

Thank you Bob, I have removed my SUM functions.

You are correct, but you had the example up so I used it that way. In my workbook, I actually don't have an E column. I used D instead as you stated.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I print a different quantity of each page? A macro maybe? unittwentyfive Word 2 04-05-2014 07:47 PM
Add a statement sma Word 6 03-23-2014 10:30 AM
Adding quantity if statement if statement piper7971 PowerPoint 1 08-19-2010 07:10 AM
automatic quantity updation of total amount is restricted. aligahk06 Excel 0 05-23-2010 08:39 AM
Adding quantity if statement Help with IF statement! CPelkey Word 1 04-12-2010 09:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft