counting data in three arrays

GraceTilly

New Member
Joined
Dec 16, 2024
Messages
9
Office Version
  1. 2021
Platform
  1. Windows
As a company, we provide uniforms for our staff
Trousers, T-Shirts, Boots, Shirts, caps, jumpers etc...obviously each come in various sizes, S,M,L,XL, boots in various sizes, 7,8,9, etc.....
What I am trying to do is create a stock sheet that tells me how much I have of each item and what size based on my original stock and what has been handed out.
Example In Cell A3 is the word Shirt and in b3,c3,d3,e3 would be Small, Medium,Large, extra large. and in the cells b4,c4,d4,e4, would be a numeric saying how many of those I have.
On a sheet within the worksheet I catalogue what comes in and what goes out so at any given time I know my stock position.
The details are entered thus, C10,date, D10,name, E10,product (ie T-shirt), F10,size and G10,quantity.
So on the at sheet I have given out 1 medium T-shirt , SO IN e10 the word T-Shirt in f10 the letter M and in G10, 1
What I want to do is use something like xlookup to determine the product, the size and other quantity and take it from my existing stock, but I am struggling to use three arrays, product, size and quantity???
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi GraceTilly,

Imagine you have a sheet 'current_inventory', 'uniforms_out' (what is given to your employees) and 'uniforms_in' (your orders in). Here's what I would do:

-English version-
Excel Formula:
=SUMIFS(uniforms_in!$D:$D,uniforms_in!$B:$B,$A3,uniforms_in!$C:$C,B$2)-SUMIFS(uniforms_out!$E:$E,uniforms_out!$C:$C,$A3,uniforms_out!$D:$D,B$2)

-French version-
Excel Formula:
=SOMME.SI.ENS(uniforms_in!$D:$D;uniforms_in!$B:$B;$A3;uniforms_in!$C:$C;B$2)-SOMME.SI.ENS(uniforms_out!$E:$E;uniforms_out!$C:$C;$A3;uniforms_out!$D:$D;B$2)

This formula make the sum of your order (in) based on uniform and size minus the total given based on uniform and size.

sheet: 'current_inventory'
Classeur1
ABCDEFGHIJ
1Stock left
2Uniforms/sizesSMLXL7891011
3Trousers5017526800000
4T-Shirts5170444300000
5Boots00006550427735
6Shirts2892695200000
7Caps49961003100000
8Jumpers2255214000000
current_inventory
Cell Formulas
RangeFormula
B3:J8B3=SUMIFS(uniforms_in!$D:$D,uniforms_in!$B:$B,$A3,uniforms_in!$C:$C,B$2)-SUMIFS(uniforms_out!$E:$E,uniforms_out!$C:$C,$A3,uniforms_out!$D:$D,B$2)


sheet: 'uniforms_out'
Classeur1
ABCDE
1datenameproductsizequantity
22024-10-21John Doe 6TrousersL1
32024-10-23John Doe 1T-ShirtsS3
42024-10-27John Doe 2Boots73
52024-10-30John Doe 7ShirtsM3
62024-12-12John Doe 1CapsS3
72024-12-21John Doe 6JumpersL1
82025-01-01John Doe 4TrousersS3
92025-01-08John Doe 7CapsM2
102025-01-09John Doe 3TrousersM3
112025-01-10John Doe 1JumpersS2
122025-01-21John Doe 7Boots73
132025-01-21John Doe 6T-ShirtsL3
142025-01-22John Doe 6Boots112
uniforms_out


sheet: 'uniforms_in'
Classeur1
ABCD
1dateproductsizequantity
22024-10-20TrousersS53
32024-10-20TrousersM20
42024-10-20TrousersL53
52024-10-20TrousersXL68
62024-10-20T-ShirtsS54
72024-10-20T-ShirtsM70
82024-10-20T-ShirtsL47
92024-10-20T-ShirtsXL43
102024-10-20Boots771
112024-10-20Boots850
122024-10-20Boots942
132024-10-20Boots1077
142024-10-20Boots1137
152024-10-20ShirtsS28
162024-10-20ShirtsM95
172024-10-20ShirtsL69
182024-10-20ShirtsXL52
192024-10-20CapsS52
202024-10-20CapsM98
212024-10-20CapsL100
222024-10-20CapsXL31
232024-10-20JumpersS24
242024-10-20JumpersM55
252024-10-20JumpersL22
262024-10-20JumpersXL40
uniforms_in


Bests regards,

Vincent
 
Upvote 0
Sorry for the delayed response, I have been going over your reply and now it is working perfectly. Thank you so much for your time and efforts
 
Upvote 0
Hi GraceTilly,

No problem. If there's somthing else don't hesitate to create a new thread! Also, if you could write the answer as solution, it would help me follow where I'm at in my followed threads.

Bests regards,

Vincent
 
Upvote 0

Forum statistics

Threads
1,226,114
Messages
6,189,052
Members
453,522
Latest member
Seeker2025

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