Formula returning #value, unsure why

usnapoleon

Board Regular
Joined
May 22, 2014
Messages
79
Office Version
  1. 365
Platform
  1. Windows
I received the following formula on a previous thread and it has worked amazingly. However, we had an issue one day where revenue reporting at 1 of our 2 outlets didnt post. The outlets are Market and Lounge and we were missing Lounge. On the excel export, the Market data got shuffled upwards in respect to the range of data. I hope that makes sense. Essentially, purely as an example, if Lounge was on row 5 normally and Market was row 6, then Market got moved up to 5 because Lounge was missing. So I need to re-write formulas to anticipate issues like this. Here is the existing formula:

=SUMPRODUCT((LEFT(B48:B73,4)=D19)*($A$48:$A$73="Blue River Lounge")*(J48:J73))+SUMIFS($J$48:$J$73,$B$48:$B$73,"Cash App",$A$48:$A$73,"Blue River Lounge")

and the context of where it was at, specifically the 'card' formula

Audit Breck Template 072023 BLANK.xlsx
ABCDE
15Breckenridge Blue River Lounge
16Tips84.08A&G0.00
17Tax48.44Cash0.00
18Food288.50Gift Card0.00
19Beverages73.50Card186.36
20Alcohol184.00House Account430.33
21Activites0.00Other55.52
22Other Categories0.00Check0.00
23Credit Card Fees6.31
24Unclassified
25678.52678.52
31
Cell Formulas
RangeFormula
E17:E18,E20:E21E17=IFERROR(INDEX(J$46:J$73,MATCH(1,(A$46:A$73="Blue River Lounge")*(B$46:B$73=D17),0)),0)
E19E19=SUMPRODUCT((LEFT(B48:B73,4)=D19)*($A$48:$A$73="Blue River Lounge")*(J48:J73))+SUMIFS($J$48:$J$73,$B$48:$B$73,"Cash App",$A$48:$A$73,"Blue River Lounge")
B16B16=H42
B17B17=G42
B18:B22B18=IFERROR(INDEX(H$30:H$90,MATCH(1,(A$30:A$90="Blue River Lounge")*(B$30:B$90=A18),0)),0)
E23E23=-K42
B25,E25B25=SUM(B16:B24)


I thought I could expand the range of the formula to begin at row 30 instead of 48, so I did a find/replace and all the formulas for other settlement types were fine, giving the same results as before, but Card came up with a #VALUE and I dont know why.

I'm using a normal day's testing data first, before I try the Market-only data. So the data below will have both Market and Lounge. Afterall, if it cant work normally, then it doesnt matter right?! After I get this figured out, I'll test the Market-only day's data.

Here is the data that the formula is looking at:

Audit Breck Template 072023 BLANK.xlsx
ABCDEFGHIJKL
30Key Stats
31Filtered By Location: Blue River Lounge, The Market
32Sales43
33Avg. Gross Sale$15.29
34Gross Sales$657.50
35Total Collected$754.74
36
37Sales Summary
38Display By Location
39Filtered By Location: Blue River Lounge, The Market
40Sales Summary Displayed by LocationGross SalesRefundsDiscounts & CompsNet SalesGift Card SalesTaxTipPartial RefundsTotal CollectedFeesNet Total
41The Market$96.00$0.00($26.00)$70.00$0.00$6.22$0.00$0.00$76.22($3.45)$72.77
42Blue River Lounge$561.50$0.00($15.50)$546.00$0.00$48.44$84.08$0.00$678.52($6.31)$672.21
43
44Payment Methods
45Display By Location
46Filtered By Location: Blue River Lounge, The Market
47LocationPayment MethodPaymentsRefundsPayment AmountRefund AmountTipsTotal CollectedFeesNet Total
48The MarketCard - Dipped (Chip)10$21.78$0.00$0.00$21.78($0.67)$21.11
49The MarketCard - Tapped (Contactless)140$44.10$0.00$0.00$44.10($2.55)$41.55
50The MarketCard - Swiped10$4.90$0.00$0.00$4.90($0.23)$4.67
51The MarketCard - Keyed00$0.00$0.00$0.00$0.00$0.00$0.00
52The MarketCard on File00$0.00$0.00$0.00$0.00$0.00$0.00
53The MarketCard - Other00$0.00$0.00$0.00$0.00$0.00$0.00
54The MarketCash00$0.00$0.00$0.00$0.00$0.00$0.00
55The MarketGift Card00$0.00$0.00$0.00$0.00$0.00$0.00
56The MarketOther00$0.00$0.00$0.00$0.00$0.00$0.00
57The MarketCash App00$0.00$0.00$0.00$0.00$0.00$0.00
58The MarketOpen Ticket00$0.00$0.00$0.00$0.00$0.00$0.00
59The MarketHouse Account10$5.44$0.00$0.00$5.44$0.00$5.44
60Blue River LoungeCard - Dipped (Chip)40$56.28$0.00$8.38$56.28($1.86)$54.42
61Blue River LoungeCard - Tapped (Contactless)80$127.68$0.00$5.75$127.68($4.12)$123.56
62Blue River LoungeCard - Swiped10$8.71$0.00$0.00$8.71($0.33)$8.38
63Blue River LoungeCard - Keyed00$0.00$0.00$0.00$0.00$0.00$0.00
64Blue River LoungeCard on File00$0.00$0.00$0.00$0.00$0.00$0.00
65Blue River LoungeCard - Other00$0.00$0.00$0.00$0.00$0.00$0.00
66Blue River LoungeCash00$0.00$0.00$0.00$0.00$0.00$0.00
67Blue River LoungeGift Card00$0.00$0.00$0.00$0.00$0.00$0.00
68Blue River LoungeOther20$55.52$0.00$0.00$55.52$0.00$55.52
69Blue River LoungeCash App00$0.00$0.00$0.00$0.00$0.00$0.00
70Blue River LoungeOpen Ticket00$0.00$0.00$0.00$0.00$0.00$0.00
71Blue River LoungeHouse Account110$430.33$0.00$69.95$430.33$0.00$430.33
31
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
which version of excel are you using?
you can add to your profile to assist with future posts.
 
Upvote 0
here's a quick explanation as to why it's happening
i have broken down the parts of your formula into : b, a & j. result is when you multiply them together, and then the sumproduct is when you insert the result into the function.

basically it doesnt like multiplying words and numbers (false are seen as 0)
--------------
Book1
MNOPQ
28column bcolumn acolumn jresultsumproduct
29
30FALSEFALSE000
31FALSEFALSE000
32FALSEFALSE000
33FALSEFALSE000
34FALSEFALSE000
35FALSEFALSE000
36FALSEFALSE000
37FALSEFALSE000
38FALSEFALSE000
39FALSEFALSE000
40FALSEFALSETotal Collected#VALUE!#VALUE!
41FALSEFALSE76.22076.22
42FALSETRUE678.520678.52
Sheet2
Cell Formulas
RangeFormula
M30:M73M30=(LEFT(B30:B73,4)=D19)
N30:N73N30=($A$30:$A$73="Blue River Lounge")
O30:O73O30=(J30:J73)
P30:P73P30=(LEFT(B30:B73,4)=D19)*($A$30:$A$73="Blue River Lounge")*(J30:J73)
Q30:Q42Q30=SUMPRODUCT(M30:P30)
Dynamic array formulas.
 
Upvote 0
try using what i have in column f below, your numbers in column b dont match mine as dont have the data those formulas are pulling from on my sheet
------------------
Book1
ABCDEF
15Breckenridge Blue River Lounge
16Tips84.08A&G00
17Tax48.44Cash00
18Food0Gift Card00
19Beverages0Card#VALUE!186.36
20Alcohol0House Account430.33430.33
21Activites0Other55.5255.52
22Other Categories0Check00
23Credit Card Fees6.31
24Unclassified
25132.52
Sheet2
Cell Formulas
RangeFormula
E17:E18,E20:E21E17=IFERROR(INDEX(J$46:J$73,MATCH(1,(A$46:A$73="Blue River Lounge")*(B$46:B$73=D17),0)),0)
E19E19=SUMPRODUCT((LEFT(B30:B73,4)=D19)*($A$30:$A$73="Blue River Lounge")*(J30:J73))+SUMIFS($J$30:$J$73,$B$30:$B$73,"Cash App",$A$30:$A$73,"Blue River Lounge")
B16B16=H42
B17B17=G42
B18:B22B18=IFERROR(INDEX(H$30:H$90,MATCH(1,(A$30:A$90="Blue River Lounge")*(B$30:B$90=A18),0)),0)
F16:F18,F20:F22F16=IFERROR(SUM(FILTER($J$30:$J$71,($B$30:$B$71=D16)*($A$30:$A$71=TEXTAFTER($A$15," ",1)),0)),0)
F19F19=SUM(FILTER($J$30:$J$71,(LEFT($B$30:$B$71,4)=D19)*($A$30:$A$71=TEXTAFTER($A$15," ",1)),0))
E23E23=-K42
B25B25=SUM(B16:B24)
 
Upvote 1
Solution
try using what i have in column f below, your numbers in column b dont match mine as dont have the data those formulas are pulling from on my sheet
------------------
Book1
ABCDEF
15Breckenridge Blue River Lounge
16Tips84.08A&G00
17Tax48.44Cash00
18Food0Gift Card00
19Beverages0Card#VALUE!186.36
20Alcohol0House Account430.33430.33
21Activites0Other55.5255.52
22Other Categories0Check00
23Credit Card Fees6.31
24Unclassified
25132.52
Sheet2
Cell Formulas
RangeFormula
E17:E18,E20:E21E17=IFERROR(INDEX(J$46:J$73,MATCH(1,(A$46:A$73="Blue River Lounge")*(B$46:B$73=D17),0)),0)
E19E19=SUMPRODUCT((LEFT(B30:B73,4)=D19)*($A$30:$A$73="Blue River Lounge")*(J30:J73))+SUMIFS($J$30:$J$73,$B$30:$B$73,"Cash App",$A$30:$A$73,"Blue River Lounge")
B16B16=H42
B17B17=G42
B18:B22B18=IFERROR(INDEX(H$30:H$90,MATCH(1,(A$30:A$90="Blue River Lounge")*(B$30:B$90=A18),0)),0)
F16:F18,F20:F22F16=IFERROR(SUM(FILTER($J$30:$J$71,($B$30:$B$71=D16)*($A$30:$A$71=TEXTAFTER($A$15," ",1)),0)),0)
F19F19=SUM(FILTER($J$30:$J$71,(LEFT($B$30:$B$71,4)=D19)*($A$30:$A$71=TEXTAFTER($A$15," ",1)),0))
E23E23=-K42
B25B25=SUM(B16:B24)

This worked!!! I need to dissect it a bit, which is a challenge when I'm on a conference call! :( How do I integrate that 'Cash App' total into it? I know its called 'cash' app, but its really running off credit cards so it's related.

Oh man, I am excited to dig into this! thank you!
 
Upvote 0
"Card - Cash App", anything that starts with first 4 characters of "Card" will be together

consider marking it as a solution to help others in the future.

no prob, happy to help
 
Upvote 0
Awesome. I've never used Filter before, I'm reading up on it now. I see how its working, making the sum of the array of $$ as it is including anything in column b with the first 4 digits matching d19 ('card') and column a matching A19 for the last 15 letters. Very interesting!!! Thank you again!!!
 
Upvote 0

Forum statistics

Threads
1,215,084
Messages
6,123,028
Members
449,092
Latest member
ikke

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