SUMIF/SUMIFS Help

Rob_010101

Board Regular
Joined
Jul 24, 2017
Messages
198
Office Version
  1. 365
Platform
  1. Windows
Hello

I am trying to track my energy usage and have a spreadsheet with two sheets

Energy Bill Tracker V1.0.xlsx
ABCDEFG
1No.Period FromPeriod toElectricGasVATTotal
2101-Mar-2229-Mar-22
Energy Bill

Energy Bill Tracker V1.0.xlsx
ABCDEFGHIJ
1No.Period fromPeriod toFuel / StandingTypePrevious ReadingLatest ReadingUnits UsedKWH Rate or Standing Charge Daily Rate (Pence)Charge
2101-Mar-2229-Mar-22ElectricDay558659101£0.2253£22.76
3101-Mar-2229-Mar-22ElectricNight10612317£0.0793£1.35
4101-Mar-2229-Mar-22GasN/A6912152£0.3542£20.58
5101-Mar-2229-Mar-22ElectricStanding charge02929£0.2272£6.59
6101-Mar-2229-Mar-22GasStanding charge02929£0.2533£7.35
Particulars
Cell Formulas
RangeFormula
H2:H6H2=IF(OR(ISBLANK(F2), ISBLANK(G2)), "", SUM(G2-F2))
J2:J3,J5:J6J2=IF(OR(ISBLANK(B2)),"",SUM(I2*H2))
J4J4=ROUNDUP(SUM(H4*39.3)*SUM(1.02264/3.6), 0)/SUM(100)*SUM(3.542)
Cells with Data Validation
CellAllowCriteria
D2:D1048576ListElectric, Gas, Electric Standing charge (daily), Gas Standing charge (daily)
E2:E1048576ListDay, Night, Standing charge, N/A

In the 'Energy Bill' sheet, under the relevant column header (D/E), I would like a sum of all the charges for the relevant type (Electric/Gas) in the 'particulars' sheet (column E), based upon the bill number in column A.

In simple terms, bill number 1, sum all charges for "electric" - and so on

Kindest
Chris
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
How about
Excel Formula:
=SUMIFS(Particulars!$J:$J,Particulars!$A:$A,$A2,Particulars!$D:$D,D$1)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0
You're welcome & thanks for the feedback.
This will work for both electricity and Gas? and when I add bill 2?

Energy Bill Tracker V1.0.xlsx
ABCDEFGHIJKL
1No.Period fromPeriod toFuel / StandingTypePrevious ReadingLatest ReadingUnits UsedKWH Rate or Standing Charge Daily Rate (Pence)ChargeVAT @ 5%Sub-total
2101-Mar-2229-Mar-22ElectricDay558659101£0.2253£22.76£1.14£23.89
3101-Mar-2229-Mar-22ElectricNight10612317£0.0793£1.35£0.07£1.42
4101-Mar-2229-Mar-22GasN/A6912152£0.3542£20.58£1.03£21.61
5101-Mar-2229-Mar-22ElectricStanding charge02929£0.2272£6.59£0.33£6.92
6101-Mar-2229-Mar-22GasStanding charge02929£0.2533£7.35£0.37£7.71
7230-Mar-2202-May-22ElectricDay65975192£0.2253£20.731.0363821.76398
8230-Mar-2202-May-22ElectricNight12314825£0.0793£1.9825£0.102.081625
9230-Mar-2202-May-22GasN/A12116342£0.3542£16.610.83059917.44258
10230-Mar-2202-May-22ElectricStanding charge03434
11230-Mar-2202-May-22GasStanding charge03434
Particulars
Cell Formulas
RangeFormula
J2:J3,J5:J8J2=IF(OR(ISBLANK(B2)),"",SUM(I2*H2))
K2:K9K2=SUM(J2/100)*5
L2:L9L2=SUM(J2+K2)
J4,J9J4=ROUNDUP(SUM(H4*39.3)*SUM(1.02264/3.6), 0)/SUM(100)*SUM(3.542)
H2:H11H2=IF(OR(ISBLANK(F2), ISBLANK(G2)), "", SUM(G2-F2))
Cells with Data Validation
CellAllowCriteria
D2:D1048576ListElectric, Gas, Electric Standing charge (daily), Gas Standing charge (daily)
E2:E1048576ListDay, Night, Standing charge, N/A
 
Upvote 0
You're welcome & thanks for the feedback.
I have changed to =SUMIFS(Particulars!J:J, Particulars!$A:$A, 'Energy Bill'!A2, Particulars!$D:$D, 'Energy Bill'!$D$1)

And now it appears to reference correctly and the formula drags down.

Thanks again!
 
Upvote 0
There was no need to change the formula, just drag it down & across.
Also you should never refer to the name of the sheet the formula is on.
 
Upvote 0
There was no need to change the formula, just drag it down & across.
Also you should never refer to the name of the sheet the formula is on.
Yes, strangely, I did that and it returned £0.00 the first few times.

I've just re-added it and tried again and it works... Excel boggles the mind.

Thank you again.
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,145
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