Forum Discussion
SUMIF Problem
I’m trying to use excel to keep an accurate count of inventory for our small church bookstore (non-profit). I decided to use UPC codes on my spreadsheet so that when I scan an item that is being sold the Product name, selling price would automatically populate my spread sheet from a VLOOKUP table. It took some work but that seems to be working.
Now I’m trying to have the worksheet automatically up-date our current stock amounts when an item is sold or we buy new/additional items for the bookstore. I’ve set up a separate tab called IN-OUT Inventory where I record the quantity of items sold or added to the inventory. When I scan a UPC code and it pulls over the Product name and selling price and I enter either a negative number for a sale or a positive number for addition to inventory.
My main tab is called Current Inventory Sheet and I’ve placed a column at the end of that spreadsheet called Beg. Stock to represent the stock we are starting out with for this year. In the Current Bookstore Inventory tab the “Total Stock” column I need it to add in the beginning stock and then search for the UPC code on the In-Out Inventory sheet. If there is a match then add or subtract that number to reflect the current stock.
I thought I had this working with a SUMIF coding but it appears that it won’t add or subtract additional transactions when there is a UPC code recorded more than one time on the IN-OUT sheet. So if I start out with 5 widgets and sell 2 it records total stock as 3; however, if I then receive 20 widgets and/or even sell 2 more it doesn’t recognize that transaction.
Any help anyone could provide is greatly appreciated. Thank you!
Here’s the link to the document:
https://1drv.ms/x/c/8fc8e0832ff0a880/EeW-INANifhPuJTiQlWVCt0BEmpuYERcvgBDBK-3R9OFXg?e=TmmWtX
The message you're getting indicates there are two different formulas in the table column. One of the benefits to using a table is having the formula auto-fill to the bottom. To resolve it, clear the entire column and re-enter the formula and it will fill to the bottom.
Edit - it appears that column was formatted as text and not calculating. Please see the fixed copy attached.
5 Replies
- MariePCopper Contributor
Hi, Thank you very much for your response. I entered the formula just as you have it there (I even did a copy and paste to see if I had messed something up) and I get an "Inconsistent calculated column formula" code. I don't understand what I may be doing wrong.
Have you tried putting the formula in the attachment I had sent? I'm so confused.
Any help is greatly appreciated! Thank you.
Marie
- Patrick2788Silver Contributor
The message you're getting indicates there are two different formulas in the table column. One of the benefits to using a table is having the formula auto-fill to the bottom. To resolve it, clear the entire column and re-enter the formula and it will fill to the bottom.
Edit - it appears that column was formatted as text and not calculating. Please see the fixed copy attached.
- MariePCopper Contributor
Not sure if my thank you message went through or not, but just in case it did not:
THANK YOU, THANK YOU, THANK YOU! I spent over a week trying everything I could think of to get this to work and was extremely frustrated. My son suggested I reach out this way and I was skeptical, I'm so thankful I listened to him. I appreciate your help more than I can express in words. I printed out your advice to refer to for any future formula issues I may have. Thank you again! May you have a very blessed day!
Marie
- Patrick2788Silver Contributor
The formula is close but only referring to 1 value in table 6. Here's a before/after. The capture on the right is the correction to be made:
=SUMIF(Table6[UPC Code],[@[UPC Code]],Table6[Qty])+[@[Beg. Stock]]