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
 
this is what I got
abdo.xlsx
CDEF
2conditionFROM DATETO DATESHEET NAME
3AA01/01/202302/01/2023CCR
4
5
6
7ITEMBALANCE
812200
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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
you have semi colons in places where I have commas. I'm not sure if that is the difference or not, as I still have the same result with either format.
Did you confirm my format of the formula worked before you made that change?

What does formula tracker do in the CHOOSE function when you step through the formula? Does it select the correct worksheet range?

And, it could be date values. Maybe convert the dates to numbers and see how they work out?
 
Upvote 0
you have semi colons in places where I have commas.
it depends on version office , not all of versions are comma .
Did you confirm my format of the formula worked before you made that change?
I click to copy to clipboard from your picture to my sheet and just change comma .
sorry my bad about amounts should be 6800 , not 11500 as I mentioned in post # 9
but strangely will show as in picture when I check the formual !:confused:
fr.PNG


And, it could be date values. Maybe convert the dates to numbers and see how they work out?
the same result .
 
Upvote 0
What are the criteria that are present when you get the 6800?
Can you post an xl2bb of that scenario?
 
Upvote 0
Also, have you updated, changed, or refreshed your data in cells CCR!A1:E9 and CVF!A1:E9? I am using the data in Post #1.
I think you are using a different set of numbers than me, as I do not see the sequence in the Formula dialog that looks like
0;0;0;0;0;2400;2200;0;0;0;2200;0;0 13 values at minimum.
on either worksheet:
CCR:
1200;2000;2200;1000;1500;2000;2200;2400;2600 (9 Values)
CVF:
1200;2000;2200;1000;1500;2000;2200;2400 (8 Values)
 
Last edited:
Upvote 0
What are the criteria that are present when you get the 6800?
sorry that was for CVF sheet , not CCR
based on picture in post#13 the calculation is right but that's doesn't happens in E8 just show 2200 whether CVF or CCR sheets !:rolleyes:
I am using the data in Post #1
me too.

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
CDEF
1
2FROM DATETO DATESHEET NAME
3AA01/01/202302/01/2023CVF
4
5
6
7ITEMBALANCE
812200
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
sorry that was for CVF sheet , not CCR
based on picture in post#13 the calculation is right but that's doesn't happens in E8 just show 2200 whether CVF or CCR sheets !:rolleyes:

me too.

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
CDEF
1
2FROM DATETO DATESHEET NAME
3AA01/01/202302/01/2023CVF
4
5
6
7ITEMBALANCE
812200
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'm really interested in this part of your image in post 13:
1699642329658.png




Please send an xl2bb of this exact scenario, that cell selected and the formula showing in the formula bar. Including the criteria cells and the columns that are being queried. I think the debugging starts at this point. No where else.
 
Upvote 0
Please send an xl2bb of this exact scenario
how I can do that ?!
just I select cell E8 where is your formula and click function from bar and shows me as you marked by red !
 
Upvote 0
how I can do that ?!
just I select cell E8 where is your formula and click function from bar and shows me as you marked by red !

@Abdo , I don't understand your xl2bb posts in post #16. I completely recreated what you have there and I get 6800 for the calculation.
Can you start a new workbook using your xl2bb data in post #16. And, see if you till get 2200. Because I certainly do not.
1699648278829.png
 
Upvote 0
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))))
 
Upvote 0

Forum statistics

Threads
1,215,103
Messages
6,123,105
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