Relative Sum based on all the cells referenced in another Cell

Ninja97

New Member
Joined
Dec 29, 2015
Messages
12
Office Version
  1. 2016
Platform
  1. Windows
I have no idea how to search for what I'm about to explain, so I apologize if this is already covered elsewhere. However, there's a good chance it hasn't.

I have a cell that sums a bunch of selected cells in the spreadsheet. Here's an example. What I have in cell BG62: =R11+R17+X15+AD11+AD18+R36+X45+AJ38+AJ40+AJ46+AJ47+R65

Each of these cells referenced in BG62 is a "profit" number from a sale. The above is just a small snippit. There are typically MANY MORE cells being added than what you see above. The cell immediately to the right of each cell contains the total retail dollars of the sale.

I want to have a cell that adds up the list of cells that are all immediately to the right of the cells referenced in BG62. How can I do this, aside from manually - like an animal?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Is there any text beside the original cells that identifies them as "profit" cells?
Could you use XL2BB to post a mini sheet showing the range Q10:AK66? (alter any sensitive data first)
 
Upvote 0
PTOP23.xlsm
HIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBH
9Walk-In, Cheap Twin10:00amNope$0.00$0.00$0.00Walk-In, Bonnie Royer & Husband9:30amMenekaunee Full$62.25#$0.00$0.00#DIV/0!#DIV/0!$374.52  Radio$0.00
10$0.00$0.00$0.00Walk-In, Lady wants Camper Queen10:00amNope$0.00$0.00$0.00  Time Saver$0.00
11Walk-In, Lyle McGuire10:30amMenekaunee Twin$45.50150Walk-In, Susan Thompson10:00amBR Select Medium w/Box$414.00#$0.00Walk-In, Jenny Corey10:30amEscanaba Queen$834.00#$0.00$0.00  Cell Phones$135.00
12$0.00$0.00$0.00Walk-In, Dude for Twin for 19yr old son11:00amNope$0.00$0.00$0.00  Vendor Surcharges$152.55
13Walk-In, Bill Younger11:30amChambers Island Queen$173.42400Walk-In, Girl & Daughter, need Dark Moon10:30amNope$0.00$0.00$0.00$0.00$0.00  Zoho.com$16.00
14$0.00$0.00$0.00Walk-In, Julie - World Famous Queen, offered her an extra 10% off12:00pmNope$0.00$0.00$0.00  Email Acct.$6.00
15$0.00$0.00Walk-In, Keith Kesler1:30pmWorld Famous Queen$371.25##$0.00$0.00$0.00NMG Dues$299.00
16$0.00$0.00$0.00$0.00$0.00$0.00Montage$0.00
17Walk-In, Dude, California King2:15pmNope$0.00Walk-In, Cheryl Redpath12:30pmEscanaba Twin$695.50#Walk-In, Lady from River Drive, Queen Escanaba2:30pmNope$0.00$0.00$0.00$0.00Facebook$128.40
18$0.00$0.00$0.00Walk-In, Karen & Tom Odegaard2:30pmCustom RV King World Famous$400.25#$0.00$0.00Gr.Web.Social Media$0.00
19$0.00$0.00$0.00Walk-In, Dude & Son2:45pmCheap FullNope$0.00$0.00$0.00Premium Waters$32.69
20$0.00$0.00$0.00$0.00$0.00$0.00Mare Hare$524.00
21$0.00Walk-In, Lady & Grandaughter4:00pmQueen Twin CitiesNope$0.00$0.00$0.00$0.00$0.00Billboards$1,276.84
22$0.00$0.00$0.00$0.00$0.00$0.00Deliveries$40.00
23$0.00$0.00$0.00$0.00$0.00$0.00Men.Cty.Journal$154.00
24$0.00$0.00$0.00$0.00$0.00$0.00Skagit$199.00
25$0.00$0.00$0.00$0.00$0.00$0.00Eagle-Herald$246.24
26$0.00$0.00$0.00$0.00$0.00$0.00  Month.Exp.$4,828.76
27  One-Off Expenses for August:
28WEEK 2  1$39.71Menards - Coffee Supplies
29Tuesday 8/08/23Wednesday 8/09/23Thursday 8/10/23Friday 8/11/23Saturday 8/12/23Sunday 8/13/23WASSPP2
30WASSPWASSPWASSPWASSPWASSPWASSP15009$5,382.79  153
314001$1,030.502001$457.902001$773.673002$744.754004$2,375.970000$0.00  4
32$0.00$0.00$0.00$0.00$0.00$0.00AppointmentsShowsProfit  5
33$0.00$0.00$0.00$0.00$0.00$0.00to Shows:to Sales:per Sale:  6
34$0.00$0.00Walk-In, Hot Chick, Firm Beautyrest Queen or King9:00amNope$0.00$0.00$0.00$0.00#DIV/0!#DIV/0!$598.09  7
35$0.00$0.00$0.00$0.00$0.00$0.00  8
36$0.00Walk-In, Rebecca Hruska10:00amTwin Cities Full w/Bunky$457.90#$0.00Walk-In, Scott Christiensen, Stephenson Island Queen w/PLTFRM10:00amMeadowbrook Queen w/PLTFRM$419.00#$0.00$0.00  9
37$0.00$0.00$0.00$0.00$0.00$0.0010
38$0.00$0.00$0.00$0.00Walk-In, Dude & Jennifer Kirt11:00amEscanaba Queen w/Dreamcool Protector$886.00$0.00Month.Exp.$39.71
39Walk-In, Andrew & Ricci Heimbuch12:00pmDark Moon King w/DF CP & DF SH$1,030.50##$0.00$0.00$0.00$0.00$0.00
40$0.00$0.00$0.00$0.00Walk-In, Suzy Miron11:45amKing Active Geldough Pillow$55.00$0.00Total Exp.$4,868.47
41$0.00$0.00$0.00$0.00$0.00$0.00
42$0.00$0.00$0.00$0.00$0.00$0.00Checks Paid to
43Walk-In, Russ & Bev2:00pmFull, Firm'ish? Bev had neck surgeryNope$0.00Walk-In, Steve Nerat, Camper Queen, $6492:00pmNope$0.00$0.00$0.00$0.00$0.00self out of this
44$0.00$0.00$0.00$0.00$0.00$0.00month's Profits:
45$0.00$0.00Walk-In, Melody Reif3:00pmBR Select Queen, w/PLTFRM & sheets & pillows$773.67##Walk-In, Dude looking for twin for teenage sone3:00pmNope$0.00$0.00$0.00  
46$0.00$0.00$0.00$0.00Walk-In, Nicolet Hamilton2:30pmStephenson Island Queen$276.75$0.00  Gross Walk-In
47Walk-In, Lady for a Full, Firm4:00pmNope$0.00$0.00$0.00$0.00Walk-In, Nicole Bebo3:00pmCrescentMoon King w/PLTFRM$1,158.22$0.00CostProfit
48$0.00$0.00$0.00$0.00$0.00$0.00Jen FB:$0.00$520.15
49Walk-In, Dude5:00pmQueen Dark Moon w/Adj.BseNope$0.00$0.00$0.00Walk-In, Jacob DeGrand5:00pmStephenson Island Queen$325.75#$0.00$0.00Shane-IDS:$0.00$0.00
50$0.00$0.00$0.00$0.00$0.00$0.00FB.Business:$128.40$0.00
51$0.00$0.00$0.00$0.00$0.00$0.00OfferUp:$0.00$0.00
52$0.00$0.00$0.00$0.00$0.00$0.00  Walk-In:$0.00$5,670.09
53$0.00$0.00$0.00$0.00$0.00$0.00  Google:$0.00$1,030.50
54  iNET:$0.00$0.00
55219WEEK 3  Restaurant:$0.00$442.00
56Tuesday 8/15/23Wednesday 8/16/23Thursday 8/17/23Friday 8/18/23Saturday 8/19/23Sunday 8/20/23WASSPPSCraigslist:$0.00$0.00
57WASSPWASSPWASSPWASSPWASSPWASSP3101$442.00  3FFR$0.00$1,158.22
580000$0.001001$442.000000$0.000100$0.000000$0.000000$0.00  Walk-In Profit -->$8,820.96
59$0.00$0.00$0.00$0.00 $0.00$0.00AppointmentsShowsProfit  
60$0.00$0.00$0.00$0.00$0.00$0.00to Shows:to Sales:per Sale:  Cash or Check:$1,311.67
61$0.00$0.00$0.00$0.00$0.00$0.000.0%#DIV/0!$442.00  PAYROCK
62$0.00$0.00$0.00$0.00$0.00$0.00  Merchant One$6,764.54
August
Cell Formulas
RangeFormula
AR61:AT61,AR34:AT34,AR9:AT9AR9=AT5/AS5
AW52:AW62,AW45:AW46,AW26:AW36,AW9:AW14AW9=AV9
AX52:AX62,AX45:AX46,AX30:AX36,AX26:AX28,AX9:AX14AX9=AU9
BF12BF12=F2
BF21BF21=450+61.5+15.34+750
BF22BF22=10+10+10+10
AP59:AP62,AJ59:AJ62,AD59:AD62,X59:X62,R59:R62,L59:L62,AP32:AP53,AJ48:AJ53,AJ41:AJ45,AJ39,AJ32:AJ37,AD50:AD53,AD37:AD48,AD32:AD35,X46:X53,X32:X44,R37:R53,R32:R35,L40:L53,L32:L38,AP9:AP26,AJ9:AJ26,AD19:AD26,AD12:AD17,AD10,X16:X26,X9:X14,R18:R26,R12:R16,R9:R10L9=(M9)
L11L11=(M11)-104.5
L13L13=(M13)-226.58
R11R11=(S11)-(108+352)
R17R17=(S17)-(503.5)
X15X15=(Y15)-327.75
AD9AD9=(AE9)-137.75
AD11AD11=(AE11)-665
AD18AD18=(AE18)-498.75
BF26BF26=SUM(BF1:BF25)-BF2
AR57:AV57,AR30:AV30AR30=B31+H31+N31+T31+Z31+AF31+AL31
AY30,AY57AY30=B31+H31+N31+T31+Z31+AF31+AL31
BF38,BH58BF38=SUM(BF28:BF37)
BF40BF40=BF26+BF38
BH48BH48=AD9+R36
BG50BG50=BF17
L31,AP58,AJ58,AD58,X58,R58,L58,AP31,AJ31,AD31,X31,R31L31=SUM(L32:L53)
L39L39=(M39)-(807.5+75+56)
R36R36=(S36)-(451.25+40.85)
X45X45=(Y45)-(352+65+95+10.83+57+26.25+26.25)
AD36AD36=(AE36)-(285+95)
AD49,AJ46AD49=(AE49)-223.25
AJ38AJ38=(AK38)-(665+48)
AJ40AJ40=(AK40)-45
AJ47AJ47=(AK47)-(830.78+110)
BH52BH52=L11+L13+R11+R17+X15+AD11+AD18+X45+AD36+AD49+AJ38+AJ40+AJ46
BH53BH53=L39
BH55BH55=R65
BH57BH57=AJ47
BG60BG60=L11+L13+AD9+L39
BG62BG62=R11+R17+X15+AD11+AD18+R36+X45+AJ38+AJ40+AJ46+AJ47+R65
 
Upvote 0
Thanks for the sample data. Unfortunately, I cannot see any logic to what you are doing.

BG62: =R11+R17+X15+AD11+AD18+R36+X45+AJ38+AJ40+AJ46+AJ47+R65
Why those cells and not also, say, L39 or AD36 or AD49 or even X31 .. etc?
 
Upvote 0
The cells that are not listed are instances where the customer paid by either cash, check, or financing. I didn't offer my spreadsheet in the first place, for a reason.

But, (and please don't read any rudeness in this question) Is my question not a valid question on its own without having to provide full context? I provided exactly every bit of information required to answer my question. It is highly likely that what I'm looking for cannot be done, and I'm prepared for that answer - I just wanted to be sure.

I'm guessing I already have my answer, and you wanted more context so that you could find a better (more realistic) way to accomplish what I need, rather than what I want. Your efforts are not unappreciated, especially since you're the only one who has taken any interest in my problem :)

Thank you.
 
Upvote 0
please don't read any rudeness in this question
No offence taken. :)

Is my question not a valid question on its own without having to provide full context?
It is, but with nearly 20 years experience in answering a lot questions in this forum I have found that in 95%+ cases when the full context is revealed, the question can be answered directly or a very simple alternative approach offered. In most of those 95%+ cases if attempting to answer without the full context, time is spent providing suggestions that turns out to be time wasted. 😎

It is highly likely that what I'm looking for cannot be done,
I don't believe that it can with standard worksheet formulas.
However, if you are happy to consider a user-defined function (post back if you need instructions to implement it) you could use this one.

VBA Code:
Function SumOffset(rBase As Range, Optional oSet As Long = 1) As Double
  Dim cAddr As Variant

  For Each cAddr In Split(Mid(rBase.Formula, 2), "+")
    SumOffset = SumOffset + Range(cAddr).Offset(, oSet).Value
  Next cAddr
End Function

On the sample worksheet, using this formula ..
Excel Formula:
=SumOffset(BG62)
.. produces the result 11,824


The cells that are not listed are instances where the customer paid by either cash, check, or financing.
So why not consider including a column relating to how the customer paid and then you could probably use a simpler SUMIFS for both the original sum and the offset sum?


BTW, thanks for updating your version details. (y)
 
Upvote 1
Solution
Perfect!

I've implemented it and it appears to work flawlessly. I've used VBA to write some seriously complex macros, but never to make a simple function. Is there ANYTHING Excel can't do? Thanks to you, I feel my Excel skills have now become fully weaponized.

Thank you, Peter.
 
Upvote 0
You're welcome. Thanks for the follow-up.
(Just needed full context. ;))
 
Upvote 0

Forum statistics

Threads
1,215,813
Messages
6,127,026
Members
449,352
Latest member
Tileni

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