populate & sum numeric data based on two dates and sheet name using options

Abdo

Board Regular
Joined
May 16, 2022
Messages
183
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Hello
I have two sheets contains data .
what I want in OUTPUT sheet when write dates in D3,E3 and sheet name in F3 and select optionbutton1 or optiobutton2 (ACTIVE X)
then should show data from row7 by summing the numbers within two dates and sheet name and optionbuttons .
the dates should match with column B in any sheet and the optionbutton will match with column D
my format date DD/MM/YYYY


ABB.xlsm
ABCDE
1ITEMDATEREFCONDITIONBALANCE
2101/01/2023RE45666AA1200.00
3201/01/2023RE45667PP2000.00
4301/01/2023RE45668AA2200.00
5401/01/2023RE45669PP1000.00
6501/01/2023RE45670AA1500.00
7602/01/2023RE45671AA2000.00
8702/01/2023RE45672AA2200.00
9802/01/2023RE45673AA2400.00
10902/01/2023RE45674PP2600.00
CCR



ABB.xlsm
ABCDE
1ITEMDATEREFCONDITIONBALANCE
2101/01/2023CV455-900PP1,200.00
3201/01/2023CV455-901PP2,000.00
4301/01/2023CV455-902AA2,200.00
5401/01/2023CV455-903PP1,000.00
6501/01/2023CV455-904PP1,500.00
7602/01/2023CV455-905PP2,000.00
8702/01/2023CV455-906AA2,200.00
9802/01/2023CV455-907AA2,400.00
CVF


ABB.xlsm
ABCDEF
1
2FROM DATETO DATESHEET NAME
3
4
5
OUTPUT


Z.PNG


the result in row7 after writing into cells and select optionbutton
ABB.xlsm
CDEF
1
2FROM DATETO DATESHEET NAME
301/01/202302/01/2023CCR
4
5
6
7ITEMBALANCE
8111500
OUTPUT


x.PNG

the data could be 4000 rows for each sheet
thanks in advance
 
with new file gives the same result ! :sick:
NEW.xlsx
ABCDE
1ITEMDATEREFCONDITIONBALANCE
2101/01/2023RE45666AA1200
3201/01/2023RE45667PP2000
4301/01/2023RE45668AA2200
5401/01/2023RE45669PP1000
6501/01/2023RE45670AA1500
7602/01/2023RE45671AA2000
8702/01/2023RE45672AA2200
9802/01/2023RE45673AA2400
10902/01/2023RE45674PP2600
CCR



NEW.xlsx
ABCDE
1ITEMDATEREFCONDITIONBALANCE
2101/01/2023CV455-900PP1200
3201/01/2023CV455-901PP2000
4301/01/2023CV455-902AA2200
5401/01/2023CV455-903PP1000
6501/01/2023CV455-904PP1500
7602/01/2023CV455-905PP2000
8702/01/2023CV455-906AA2200
9802/01/2023CV455-907AA2400
CVF





NEW.xlsx
CDEF
1
2FROM DATETO DATESHEET NAME
3AA01/01/202302/01/2023CVF
4
5
6
7ITEMBALANCE
812200
9
OUTPUT
Cell Formulas
RangeFormula
D8D8=SUM(((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$B$2:$B$4000,CVF!$B$2:$B$4000))>=D3)* ((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$B$2:$B$4000,CVF!$B$2:$B$4000))<=E3)* ((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$D$2:$D$4000,CVF!$D$2:$D$4000))=C3))
E8E8=SUM(((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$B$2:$B$4000,CVF!$B$2:$B$4000))>=D3)* ((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$B$2:$B$4000,CVF!$B$2:$B$4000))<=E3)* ((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$D$2:$D$4000,CVF!$D$2:$D$4000))=C3)* ((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$E$2:$E$4000,CVF!$E$2:$E$4000))))
I cannot explain it.
I just copied all three of your mini worksheets above into a brand new workbook and got 6800 and 3

Book1
ABCDEFG
1
2FROM DATETO DATESHEET NAME
3AA2023-01-012023-01-02CVF
4
5
6
7ITEMBALANCE
836800
9
OUTPUT
Cell Formulas
RangeFormula
D8D8=SUM(((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$B$2:$B$4000,CVF!$B$2:$B$4000))>=D3)* ((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$B$2:$B$4000,CVF!$B$2:$B$4000))<=E3)* ((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$D$2:$D$4000,CVF!$D$2:$D$4000))=C3))
E8E8=SUM(((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$B$2:$B$4000,CVF!$B$2:$B$4000))>=D3)* ((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$B$2:$B$4000,CVF!$B$2:$B$4000))<=E3)* ((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$D$2:$D$4000,CVF!$D$2:$D$4000))=C3)* ((CHOOSE(MATCH(F3,{"CCR";"CVF"},0),CCR!$E$2:$E$4000,CVF!$E$2:$E$4000))))
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
What I would like you to do is to again display the formula editor and look to see the values that are captured with the formula, for the one that give you a result of 2200.

1699916076980.png
 
Upvote 0
Try changing SUM to SUMPRODUCT.

@Abdo, are you using a 2010 version or a 2019 version in this situation? I may write this wrong, but SUM doesn't do the array mathematics like
SUMPRODUCT in earlier versions.

Thanks @Fluff for stepping in with that suggestion!
 
Upvote 0
You would have to use CSE (or sumproduct) on anything earlier than 2021
 
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,097
Members
449,096
Latest member
provoking

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