Sum column entries based on referenced values in another cell

crumber_nuncher

New Member
Joined
Jul 30, 2015
Messages
2
Hello all,

Apologies in advance because I've tried searching for this, but I'm running into issues because I'm not really sure what formula I should be using. :confused:

I think the command I'm hoping to use is DSUM, but I can't get it to work so I'm not sure if I'm messing it up or barking up the wrong tree? I have syntax issues on a good day, haha.

I have Data in Sheet1. 50+ columns, 2000+ rows, formatted as table, yada yada.
In Sheet2, I'm wanting to return or sum only certain cells from one of the columns, but based off another cell in another column.


Sheet1 (data is formatted as a table: "Data_All")​

SerialCustomerAgreementMeterReading
ABC12345678Completely Fake Company, LLP11045800143524
DEF90123456Completely Fake Company, LLP110458002213
GHI78998765Completely Fake Company, LLP1104580086644
RND0254684Completely Fake Company, LLP0956870045562
ZZZ00025469Completely Fake Company, LLP09568700322863
ABC09876543Next Entity in List15200018727

<tbody>
</tbody>

I'm needing to tally [Reading] from 'Sheet1' based on [Agreement], without specifically referencing the cells (because they are not usually in the neat order you see here).



Sheet2​

AgreementCustomerTally
110458Completely Fake Company, LLPx
095687Completely Fake Company, LLPx
152000Next Entity in Listx

<tbody>
</tbody>

<tbody>
</tbody>
Example: x on first line would = 43524+213+6644 = 50381



Here's what I'm trying in Sheet2:
=DSUM(Data_All,Data_All[Reading],MATCH(A2,Data_All[Agreement]))

Evaluation fails at italicized section:
=DSUM('Sheet1'!$A2:BO$2000,'Sheet1'!$T$2:$T$2000,MATCH("110458",'Sheet1'!$AW$2:$AW$2000))

Obviously I have more columns at play here based on the evaluation returns, but it looks like it's so close to properly referencing that it's driving me nuts. Is what I'm trying to do even possible? Is it me and syntax again, or is there a better command to use?
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
This would work if you're only matching the criteria of the Agreement #. Adjust ranges to suit your data.

=SUMIF(Sheet6!$A$1:$A$6,"="&A1,Sheet6!$B$1:$B$6)

Sheet6 = your data table sheet, A1:A6 is your reading column on data sheet, A1 is agreement cell on summary sheet, B1:B6 is your agreement column on data sheet. Paste in first cell in your tally column and copy down.

If you need to match more criteria, this can be adjusted.
 
Upvote 0
=SUMIF('Sheet1'!$AW$2:$AW$2000, "110458",'Sheet1'!$T$2:$T$2000)

if AW contains Agreement and T contains Reading, change "110458" to 110458 if Agreement is a number


Hello all,

Apologies in advance because I've tried searching for this, but I'm running into issues because I'm not really sure what formula I should be using. :confused:

I think the command I'm hoping to use is DSUM, but I can't get it to work so I'm not sure if I'm messing it up or barking up the wrong tree? I have syntax issues on a good day, haha.

I have Data in Sheet1. 50+ columns, 2000+ rows, formatted as table, yada yada.
In Sheet2, I'm wanting to return or sum only certain cells from one of the columns, but based off another cell in another column.


Sheet1 (data is formatted as a table: "Data_All")​

SerialCustomerAgreementMeterReading
ABC12345678Completely Fake Company, LLP11045800143524
DEF90123456Completely Fake Company, LLP110458002213
GHI78998765Completely Fake Company, LLP1104580086644
RND0254684Completely Fake Company, LLP0956870045562
ZZZ00025469Completely Fake Company, LLP09568700322863
ABC09876543Next Entity in List15200018727

<tbody>
</tbody>

I'm needing to tally [Reading] from 'Sheet1' based on [Agreement], without specifically referencing the cells (because they are not usually in the neat order you see here).



Sheet2​

AgreementCustomerTally
110458Completely Fake Company, LLPx
095687Completely Fake Company, LLPx
152000Next Entity in Listx

<tbody>
</tbody>

<tbody>
</tbody>
Example: x on first line would = 43524+213+6644 = 50381



Here's what I'm trying in Sheet2:
=DSUM(Data_All,Data_All[Reading],MATCH(A2,Data_All[Agreement]))

Evaluation fails at italicized section:
=DSUM('Sheet1'!$A2:BO$2000,'Sheet1'!$T$2:$T$2000,MATCH("110458",'Sheet1'!$AW$2:$AW$2000))

Obviously I have more columns at play here based on the evaluation returns, but it looks like it's so close to properly referencing that it's driving me nuts. Is what I'm trying to do even possible? Is it me and syntax again, or is there a better command to use?
 
Upvote 0
=SUMIF('Sheet1'!$AW$2:$AW$2000, "110458",'Sheet1'!$T$2:$T$2000)

=SUMIF(Sheet6!$A$1:$A$6,"="&A1,Sheet6!$B$1:$B$6)

Hello jarjarbingie & dreid1011,
Thanks for quick replies guys!

In a roundabout way, I stuck to my guns with table references, and incorporated both your suggestions for a clean fix.

After I reversed the range and criteria. I ended up going with:
=SUMIF(Data_All[Agreement],"="&A2,Data_All[Reading]) which resolves to
=SUMIF('Sheet1'!$AW$2:$AW$2000,"="&A2,'Sheet1'!$T$2:$T$2000)

I am going to experiment with a variation on this tomorrow =SUMIFS(), and see if I can inject more criteria in there without breaking my brain.

Thanks for pointing me in the right direction!
--Russ
 
Upvote 0

Forum statistics

Threads
1,217,016
Messages
6,134,040
Members
449,856
Latest member
harry234

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