Sum 2-dimension array

hadoanpapvn

New Member
Joined
Jun 26, 2019
Messages
3
Hi Everyone

I have the excel file to control storage as attached link.

The Sheet1 is an storage, and sheet2 contains goods which I want to take out....

I want to compare the quantity at Sheet2 with quantity at Sheet1 of item "Apple" with code is "AP" base on the current date&time and Expire Date.... If the Sheet2's "Apple" item quantity larger than Sheet1's "Apple" Total Product Quantity ( not expire date ) then the program will show alert "Not Enough"

Pls check my file & code and support me edit it.

Thanks you so much!

https://drive.google.com/file/d/1lS1COAUeCaJP8sO9HwApBwdrfapPW5C_/view?usp=sharing
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
=IF(E2>SUMIF(Sheet1!$B$2:$B$7,Sheet2!C2,Sheet1!$D$2:$D$7),"Not Enough","Enough")
 
Last edited:
Upvote 0
Hi Bro.

Thanks you but I want to use vba macro to do this

And the quantity must follow with expire date which compare with current date time
 
Upvote 0
=SUMIFS(Sheet1!$D$2:$D$7,Sheet1!$B$2:$B$7,Sheet2!C2,Sheet1!$E$2:$E$7,">="&TODAY())

considers the expire date.

What do you want the macro to do? Put the formula in each cell or something else?
 
Upvote 0

Forum statistics

Threads
1,213,557
Messages
6,114,288
Members
448,563
Latest member
MushtaqAli

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