Totaling Heat Types by Towns

mkeohan

New Member
Joined
Jun 14, 2018
Messages
13
Hello Everyone,

I have a large list of addresses that have heat system types associated with them. I want to be able to get it into a format where it is just the town name and a total number of each heat type. I would normally do this manually but there are over 1 million addresses in this file. This forum wont let me post attachments for whatever reason so I have copied it below.

MA023512308745
MA023512308844
MA023512307719
MA023511526267
MA023511526366
MA023511525475
MA023512229374
MA023512229338
MA023512514142
Pond StMA0232202322-16241624431
Pond StMA0232202322-16241624297
Pond StMA0232202322-16241624954
KING STMA0232202322-12051205058
MA0232202322-12441244064
MA0232202322-12441244082

<colgroup><col style="width:48pt" width="64" span="5"> <col style="width:48pt" width="64"> <col style="width:48pt" width="64" span="6"> <col style="width:48pt" width="64"> </colgroup><tbody>
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="class: xl63, width: 64"]Town[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"]HEAT SYS[/TD]

[TD="colspan: 2"]CONSTITUTION AVE[/TD]
[TD="class: xl63"]ABINGTON[/TD]

[TD="class: xl63"]ELC[/TD]

[TD="colspan: 2"]CONSTITUTION AVE[/TD]
[TD="class: xl63"]ABINGTON[/TD]

[TD="class: xl63"]ELC[/TD]

[TD="colspan: 2"]CONSTITUTION AVE[/TD]
[TD="class: xl63"]ABINGTON[/TD]

[TD="class: xl63"]ELC[/TD]

[TD="colspan: 2"]Jennings Dr[/TD]
[TD="class: xl63"]Abington[/TD]

[TD="class: xl63"]Gas[/TD]

[TD="colspan: 2"]Jennings Dr[/TD]
[TD="class: xl63"]Abington[/TD]

[TD="class: xl63"]Gas[/TD]

[TD="colspan: 2"]Jennings Dr[/TD]
[TD="class: xl63"]Abington[/TD]

[TD="class: xl63"]Gas[/TD]

[TD="colspan: 2"]CENTRE AVE[/TD]
[TD="class: xl63"]ABINGTON[/TD]

[TD="class: xl63"]Oil[/TD]

[TD="colspan: 2"]CENTRE AVE[/TD]
[TD="class: xl63"]ABINGTON[/TD]

[TD="class: xl63"]Oil[/TD]

[TD="colspan: 2"]CHERRY ST[/TD]
[TD="class: xl63"]ABINGTON[/TD]

[TD="class: xl63"]Oil[/TD]

[TD="class: xl63"]Avon[/TD]

[TD="class: xl63"]Gas[/TD]

[TD="class: xl63"]Avon[/TD]

[TD="class: xl63"]Gas[/TD]

[TD="class: xl63"]Avon[/TD]

[TD="class: xl63"]Gas[/TD]

[TD="class: xl63"]AVON[/TD]

[TD="class: xl63"]Oil[/TD]

[TD="colspan: 2"]BLANCHARD ST[/TD]
[TD="class: xl63"]AVON[/TD]

[TD="class: xl63"]Oil[/TD]

[TD="colspan: 2"]BLANCHARD ST
[/TD]
[TD="class: xl63"]AVON[/TD]

[TD="class: xl63"]Oil
[/TD]

</tbody>

The desired result would be:

Abington
Avon

<colgroup><col style="width:48pt" width="64" span="4"> </colgroup><tbody>
[TD="width: 64"][/TD]
[TD="width: 64"]ELEC[/TD]
[TD="width: 64"]GAS[/TD]
[TD="width: 64"]OIL[/TD]

[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]

[TD="align: right"]3[/TD]
[TD="align: right"]3
[/TD]

</tbody>

The two columns in questions are F=Towns and M=Heat Type

Please let me know if any of you can help. Thanks!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
You can use COUNTIFS to do this.

Suppose that your data is in rows 2:16.
And then your summary has the town names in column P (so "Abington" is in cell P2, and "Avon" is in cell P3)
and the heat types are in cells Q1:S1.

Then place this formula in cell Q2 and copy to S3:
Code:
=COUNTIFS($F$2:$F$16,$P2,$M$2:$M$16,Q$1)
 
Upvote 0
using PowerQuery
- remove unnecessary columns
- capitalize words
- duplicate column
- pivot


[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]Column1[/td][td=bgcolor:#5B9BD5]Town[/td][td=bgcolor:#5B9BD5]Column2[/td][td=bgcolor:#5B9BD5]Column3[/td][td=bgcolor:#5B9BD5]Column4[/td][td=bgcolor:#5B9BD5]HEAT SYS[/td][td=bgcolor:#5B9BD5]Column5[/td][td=bgcolor:#5B9BD5]Column6[/td][td][/td][td=bgcolor:#70AD47]Town[/td][td=bgcolor:#70AD47]ELC[/td][td=bgcolor:#70AD47]Gas[/td][td=bgcolor:#70AD47]Oil[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]CONSTITUTION AVE[/td][td=bgcolor:#DDEBF7]ABINGTON[/td][td=bgcolor:#DDEBF7]MA[/td][td=bgcolor:#DDEBF7]
2351​
[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]
2308​
[/td][td=bgcolor:#DDEBF7]
745​
[/td][td=bgcolor:#DDEBF7]ELC[/td][td][/td][td=bgcolor:#E2EFDA]Abington[/td][td=bgcolor:#E2EFDA]
3​
[/td][td=bgcolor:#E2EFDA]
3​
[/td][td=bgcolor:#E2EFDA]
3​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]CONSTITUTION AVE[/td][td]ABINGTON[/td][td]MA[/td][td]
2351​
[/td][td][/td][td]
2308​
[/td][td]
844​
[/td][td]ELC[/td][td][/td][td]Avon[/td][td]
0​
[/td][td]
3​
[/td][td]
3​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]CONSTITUTION AVE[/td][td=bgcolor:#DDEBF7]ABINGTON[/td][td=bgcolor:#DDEBF7]MA[/td][td=bgcolor:#DDEBF7]
2351​
[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]
2307​
[/td][td=bgcolor:#DDEBF7]
719​
[/td][td=bgcolor:#DDEBF7]ELC[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Jennings Dr[/td][td]Abington[/td][td]MA[/td][td]
2351​
[/td][td][/td][td]
1526​
[/td][td]
267​
[/td][td]Gas[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Jennings Dr[/td][td=bgcolor:#DDEBF7]Abington[/td][td=bgcolor:#DDEBF7]MA[/td][td=bgcolor:#DDEBF7]
2351​
[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]
1526​
[/td][td=bgcolor:#DDEBF7]
366​
[/td][td=bgcolor:#DDEBF7]Gas[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Jennings Dr[/td][td]Abington[/td][td]MA[/td][td]
2351​
[/td][td][/td][td]
1525​
[/td][td]
475​
[/td][td]Gas[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]CENTRE AVE[/td][td=bgcolor:#DDEBF7]ABINGTON[/td][td=bgcolor:#DDEBF7]MA[/td][td=bgcolor:#DDEBF7]
2351​
[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]
2229​
[/td][td=bgcolor:#DDEBF7]
374​
[/td][td=bgcolor:#DDEBF7]Oil[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]CENTRE AVE[/td][td]ABINGTON[/td][td]MA[/td][td]
2351​
[/td][td][/td][td]
2229​
[/td][td]
338​
[/td][td]Oil[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]CHERRY ST[/td][td=bgcolor:#DDEBF7]ABINGTON[/td][td=bgcolor:#DDEBF7]MA[/td][td=bgcolor:#DDEBF7]
2351​
[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]
2514​
[/td][td=bgcolor:#DDEBF7]
142​
[/td][td=bgcolor:#DDEBF7]Oil[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Pond St[/td][td]Avon[/td][td]MA[/td][td]
2322​
[/td][td]02322-1624[/td][td]
1624​
[/td][td]
431​
[/td][td]Gas[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Pond St[/td][td=bgcolor:#DDEBF7]Avon[/td][td=bgcolor:#DDEBF7]MA[/td][td=bgcolor:#DDEBF7]
2322​
[/td][td=bgcolor:#DDEBF7]02322-1624[/td][td=bgcolor:#DDEBF7]
1624​
[/td][td=bgcolor:#DDEBF7]
297​
[/td][td=bgcolor:#DDEBF7]Gas[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Pond St[/td][td]Avon[/td][td]MA[/td][td]
2322​
[/td][td]02322-1624[/td][td]
1624​
[/td][td]
954​
[/td][td]Gas[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]KING ST[/td][td=bgcolor:#DDEBF7]AVON[/td][td=bgcolor:#DDEBF7]MA[/td][td=bgcolor:#DDEBF7]
2322​
[/td][td=bgcolor:#DDEBF7]02322-1205[/td][td=bgcolor:#DDEBF7]
1205​
[/td][td=bgcolor:#DDEBF7]
58​
[/td][td=bgcolor:#DDEBF7]Oil[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]BLANCHARD ST[/td][td]AVON[/td][td]MA[/td][td]
2322​
[/td][td]02322-1244[/td][td]
1244​
[/td][td]
64​
[/td][td]Oil[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]BLANCHARD ST[/td][td=bgcolor:#DDEBF7]AVON[/td][td=bgcolor:#DDEBF7]MA[/td][td=bgcolor:#DDEBF7]
2322​
[/td][td=bgcolor:#DDEBF7]02322-1244[/td][td=bgcolor:#DDEBF7]
1244​
[/td][td=bgcolor:#DDEBF7]
82​
[/td][td=bgcolor:#DDEBF7]Oil[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]
 
Upvote 0
Still having trouble here. Is what I used with that for that formula =COUNTIFS($F$2:$F$937063,$CE2,$M$2:$M$937063,CF$1) am I doing it right? I only get a zero as an answer. Those are the data ranges I had to move the P and Q down because I didn't include those rows for privacy reasons
 
Upvote 0
Try hard-coding the first one, just to test, i.e.
Code:
[COLOR=#333333]=COUNTIFS($F$2:$F$937063,"Abington",$M$2:$M$937063,"ELC")[/COLOR]
If that does not work, that probably means that you have extra characters in your data.
Check a row that should match, and see if there are any extra spaces on the word "ABINGTON" or "ELC".
 
Upvote 0
That worked! It gave me a value that is correct. How to I apply it to the whole sheet?
Is "Abington" in CE2 and "ELC" in "CF1"?
If so, then your original formula should have worked too.
If not, then you either have the wrong addresses there, or you have a typo in one of those cells.
 
Upvote 0

Similar threads

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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