Retrieve info with different date formats

tigerzen

Board Regular
Joined
Mar 8, 2023
Messages
209
Office Version
  1. 365
Platform
  1. Windows
Would like to try and have the column in yellow fill with a formula/function, the monthly summed values come from the table in Columns G&H. Can I please have this in Excel 2019. The challenge is with the 2 different date formats.

Book6
ABCDEFGH
2DateAmountContributionsDateContributions
31/12/2021$ 1,000Feb-22$ 100
41/01/2022$ 1,500Feb-22$ 200
51/02/2022$ 2,500$450Feb-22$ 150
61/03/2022$ 4,000Apr-22$ 300
71/04/2022$ 6,000$300May-22$ 200
81/05/2022$ 8,000$500May-22$ 300
91/06/2022$ 12,000
101/07/2022$ 15,000
Sheet1
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hello, if all the dates are "1st of a month" as it is above, then:

Excel Formula:
=IF(SUMIFS($H$2:$H$7,$G$2:$G$7,B2)=0,"",SUMIFS($H$2:$H$7,$G$2:$G$7,B2))
 
Upvote 0
Thanks Hagia_sofia that works fine. If the dates in column B were not the 1st of the month eg 5/1/2022 or 19/1/2022 what would you modify in the formula to make it work?
 
Upvote 0
Two options: Using SUMIFS or SUMPRODUCT

Book1
ABCDEFGH
1Using SUMIFSUsing SUMPRODUCT
2DateAmountContributionsDateContributions
3112-Jan-2110000022-Feb100
411-Jan-2215000022-Feb200
521-Feb-22250045045022-Feb150
631-Mar-2240000022-Apr300
741-Apr-22600030030022-May200
851-May-22800050050022-May300
961-Jun-221200000
1071-Jul-221500000
Sheet1
Cell Formulas
RangeFormula
D3:D10D3=SUMIFS($H$3:$H$8,$G$3:$G$8,">=" & B3,$G$3:$G$8,"<=" & EOMONTH(B3,0))
E3:E10E3=SUMPRODUCT((TEXT($G$3:$G$8,"mm/yyyy")=TEXT(B3,"mm/yyyy"))*$H$3:$H$8)
A3:A10A3=MONTH(B3)
 
Upvote 0
Two options: Using SUMIFS or SUMPRODUCT

Book1
ABCDEFGH
1Using SUMIFSUsing SUMPRODUCT
2DateAmountContributionsDateContributions
3112-Jan-2110000022-Feb100
411-Jan-2215000022-Feb200
521-Feb-22250045045022-Feb150
631-Mar-2240000022-Apr300
741-Apr-22600030030022-May200
851-May-22800050050022-May300
961-Jun-221200000
1071-Jul-221500000
Sheet1
Cell Formulas
RangeFormula
D3:D10D3=SUMIFS($H$3:$H$8,$G$3:$G$8,">=" & B3,$G$3:$G$8,"<=" & EOMONTH(B3,0))
E3:E10E3=SUMPRODUCT((TEXT($G$3:$G$8,"mm/yyyy")=TEXT(B3,"mm/yyyy"))*$H$3:$H$8)
A3:A10A3=MONTH(B3)
Thanks Bebo, the formulae look good. When I copy your solution into a new file, both the SUMIFs and SUMPRODUCT formulae return 0s for all the cells. The other issue is that your MONTH formula will only work for one year ie if there is Feb 2022 and Feb 2023 then the formulae picks up for all Feb and I need it to be different for each Feb period.
 
Upvote 0
Try to attach new mini sheet with results of 0s?
Book3
ABCDEFGH
1Using SUMIFSUsing SUMPRODUCT
2DateAmountContributionsDateContributions
3112-Jan-2110000022-Feb100
411-Jan-2215000022-Feb200
521-Feb-2225000022-Feb150
631-Mar-2240000022-Apr300
741-Apr-2260000022-May200
851-May-2280000022-May300
961-Jun-221200000
1071-Jul-221500000
Sheet1
Cell Formulas
RangeFormula
D3:D10D3=SUMIFS($H$3:$H$8,$G$3:$G$8,">=" & B3,$G$3:$G$8,"<=" & EOMONTH(B3,0))
E3:E10E3=SUMPRODUCT((TEXT($G$3:$G$8,"mm/yyyy")=TEXT(B3,"mm/yyyy"))*$H$3:$H$8)
A3:A10A3=MONTH(B3)
 
Upvote 0
The issue is not with bebo's formula but something has gone wrong with the dates in column G.
Just copy your original dates in column G in post #1 to the Book3 data you just posted and it should work fine.
 
Upvote 0
The issue is not with bebo's formula but something has gone wrong with the dates in column G.
Just copy your original dates in column G in post #1 to the Book3 data you just posted and it should work fine.
Thanks Alex, you're right, something happens to the date format with the XLBB process. Once format is corrected, formulae work well.
 
Upvote 0

Forum statistics

Threads
1,223,881
Messages
6,175,159
Members
452,615
Latest member
bogeys2birdies

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