Excel

%3CLINGO-SUB%20id%3D%22lingo-sub-1567585%22%20slang%3D%22en-US%22%3EExcel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1567585%22%20slang%3D%22en-US%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3EI%20have%203%20tables%3A%20basic%20stock%20%2C%20issuing%20%2C%20procurement.%20I%20want%20make%20sure%20that%20the%20current%20stock%20is%20equal%20to%20the%20quantity%20issued%20by%20reference%2C%20subtracted%20from%20the%20quantity%20counted%20and%20added%20to%20the%20quantity%20procured.%20A%20bit%20like%20%3A%20Current%20stock%20%3D%20Quantity%20counted%20%2B%20quantity%20procured%20-%20quantity%20issued%20(NB%3A%20the%20calculation%20must%20be%20done%20even%20if%20the%20order%20of%20positioning%20of%20the%20references%20in%20the%20basic%20table%20is%20not%20respected%20in%20the%202%20others)%3C%2FP%3E%3CP%3EPlease%20help!!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1567585%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1571299%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1571299%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F750325%22%20target%3D%22_blank%22%3E%40KandasD%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20you're%20asking%20would%20appear--and%20I%20emphasize%20the%20word%20%22%3CEM%3Eappear%3C%2FEM%3E%22--to%20be%20a%20very%20straightforward%20matter%20(as%20your%20%22A%20bit%20like%22%20sentence%20suggests).%20Yet%20it%20apparently%20is%20NOT%20straightforward%2C%20which%20is%20why%20you're%20asking%20for%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20would%20be%20helpful%20to%20those%20of%20us%20desiring%20to%20help%20you%20if%20you%20would%20post%20your%20actual%20workbook--absent%20any%20confidential%20information--because%20otherwise%20all%20we%20can%20do%20is%20speculate%20and%20offer%20general%20and%20hypothetical%20suggestions.%20We'd%20need%20to%20see%20how%20these%20tables%20are%20laid%20out.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20could%20you%20inform%20us%20as%20to%20which%20version%20of%20Excel%20you're%20using...there%20are%20functions%20available%20in%20the%20most%20recent%20versions%20that%20are%20not%20available%20in%20older%20versions%2C%20functions%20that%20might%20be%20critical%20for%20your%20application.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1572783%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1572783%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHello%2C%20thank%20you%20very%20much%20indeed%20for%20your%20reply.%20Herewith%20an%20explanation%20of%20what%20I%20mean.%20Hopefully%20it%20will%20make%20sense%20to%20you%20and%20guide%20you%20to%20help%20me.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1572791%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1572791%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F750325%22%20target%3D%22_blank%22%3E%40KandasD%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESomething%20like%2C%26nbsp%3B%3CSPAN%3ECurrent%20stock%3A%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3D%20Initial_Quantity%0A%20%20%2B%20SUMIFS(quantity_procured%2C%20date_procured%2C%22%26lt%3B%3D%22%26amp%3Bcurrent_date)%0A%20%20-%20SUMIFS(%20quantity_issued%2C%20date_issued%2C%26nbsp%3B%22%26lt%3B%3D%22%26amp%3Bcurrent_date)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1572914%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1572914%22%20slang%3D%22en-US%22%3EThank%20you%20for%20your%20reply.%3CBR%20%2F%3EIt%20works%20but%20only%20if%20I%20write%20the%20items%20in%20the%20order%20of%20the%20Warehouse%20table.%20How%20can%20I%20combine%20it%20with%20''vlookup%22%3F%20because%20items%20are%20not%20received%20or%20issued%20in%20order.%20Sometimes%20one%20article%20may%20stay%20untouched%20for%20days%20so%20I%20want%20it%20to%20search%20the%20issued%20or%20procured%20article%20and%20do%20the%20calculation.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1572834%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1572834%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F750325%22%20target%3D%22_blank%22%3E%40KandasD%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20looks%20to%20me%20as%20if%20the%20reply%20you%20got%20from%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F214174%22%20target%3D%22_blank%22%3E%40Peter%20Bartholomew%3C%2FA%3E%20should%20work.%20Let%20us%20know.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello

I have 3 tables: basic stock , issuing , procurement. I want make sure that the current stock is equal to the quantity issued by reference, subtracted from the quantity counted and added to the quantity procured. A bit like : Current stock = Quantity counted + quantity procured - quantity issued (NB: the calculation must be done even if the order of positioning of the references in the basic table is not respected in the 2 others)

Please help!!!

18 Replies

@KandasD 

 

What you're asking would appear--and I emphasize the word "appear"--to be a very straightforward matter (as your "A bit like" sentence suggests). Yet it apparently is NOT straightforward, which is why you're asking for help.

 

It would be helpful to those of us desiring to help you if you would post your actual workbook--absent any confidential information--because otherwise all we can do is speculate and offer general and hypothetical suggestions. We'd need to see how these tables are laid out.

 

And could you inform us as to which version of Excel you're using...there are functions available in the most recent versions that are not available in older versions, functions that might be critical for your application.

@mathetes 

Hello, thank you very much indeed for your reply. Herewith an explanation of what I mean. Hopefully it will make sense to you and guide you to help me.

@KandasD 

Something like, Current stock:

= Initial_Quantity
  + SUMIFS(quantity_procured, date_procured,"<="&current_date)
  - SUMIFS( quantity_issued, date_issued, "<="&current_date)

 

@KandasD 

 

It looks to me as if the reply you got from @Peter Bartholomew should work. Let us know.

Thank you for your reply.
It works but only if I write the items in the order of the Warehouse table. How can I combine it with ''vlookup"? because items are not received or issued in order. Sometimes one article may stay untouched for days so I want it to search the issued or procured article and do the calculation.

@KandasD 

Are you able to add criteria to match the product id to the SUMIFS function?

 

Are you able in your version of Excel to use the new FILTER function? Just try entering =FILTER and see if it accepts it. If so, it's a more powerful tool than VLOOKUP to match entries in your subordinate tables with the exact product...

@mathetes 

Indeed it works. It just needs to search in the table the corresponding article and calculate no matter its position in the warehouse table.

 

I will try
I see "filter.xml" I don't know if this is it.

@KandasD 

 

Here's a solution using FILTER, if your software works with it. I didn't yet incorporate the date, because we want first to see if it works at all.

=D5+SUM(FILTER($E$19:$E$22,$C$19:$C$22=$B5,0))-SUM(FILTER($E$12:$E$15,$C$12:$C$15=B5,0))

 

Copy this from E5 down the rest of the rows in your "Warehouse" table.

@KandasD 

 

No. That means you would need to upgrade to the most current version. Is that possible? This video will introduce you to the capabilities.

 

https://www.youtube.com/watch?v=9I9DtFOVPIg

Learn everything about our brand-new Dynamic Arrays and how you can use them to build advanced spreadsheets. Arrays (CSE) have long been present in Excel, bu...
Okay
Is there a possibility for this to search and extract the reference and then calculate its quantity?

@KandasD 

So far I have seen nothing to suggest it is important to search out quantities in any particular order.  Both the SUMIFS function and the more limited SUMIF that preceded it run through an entire column of data summing where a condition is met.

 

As far as VLOOKUP is concerned, there are other lookup functions that do twice as much, twice as well.

 

@Peter Bartholomew 

 

One of the conditions, in addition to the date match, that your SUMIFS gets, is to match the product code as well, recognizing there can be multiple entries in the Procure or Distribute table for any given product. That's what @KandasD is looking for.

Exactly
the info of the product should all match as well

@mathetes 

True.  For my own work, I have pensioned off both SUMIF AND COUNTIF on the grounds that they achieve nothing that cannot be performed with their '...IFS' equivalent, and so simply represent 'bloat'.

 

In the present case, I found the item references to match but no obvious date cut-offs.  Since I cannot remember when the '...IFS family came in, I decided not to risk SUMIFS when I only had a single-criterion (maybe, Office 2007?).