VLOOKUP creating spill error

nicic

New Member
Joined
Sep 20, 2023
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Driving me mad. I had this working perfectly. Now for some reason, it's not :(
It either comes up with a spill error, or doesn't work at all. Not sure if I can share the workbook?
Honestly, I had this code sorted weeks ago, and it's been running fine.

I've checked previous versions and it's not working on there either... no idea what I have done...


=IF(ISNA(VLOOKUP(B10:B28,'Master Price List'!$B$7:$F$5000,5,FALSE)),"",VLOOKUP(B10:B28,'Master Price List'!$B$7:$F$5000,5,FALSE))

And then it worked again, and then stopped.... arrghhh...
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Mr. Excel has a tool called xl2bb add in that allows posting of mini worksheets. (Link below).
In this circumstance it is really critical that you share the underlying range (a portion of it). as well as the location and surrounding cells of where you have the formula.
 
Upvote 0
Soap Costings Spreadsheet v1a.xlsm
ABCDEFGHIJKLMNO
2Solid Lotion - Peppermint
3
4How many units of product does your Batch make?14Total Cost per item (Ingredients, Packing and other costs)£0.75
5
6
7Recipe Cost (per Batch)Packaging & Other Costs (per item)RRP by Multiply
8Ingredientsg in recipeCost per gramCost ItemQtyCost per itemCost Multiply by5
9Suggested RRP£3.76
10Clay - Purple Brazilian 20.118615g tin10.3120.312Gross Profit per bar£3.01
11Beeswax (SP)15g Tin stickers (back)10.110.11Gross Profit per batch£42.11
12Beeswax (SP)15g Tin stickers (front)10.110.11% Profit80%
1315g Tin stickers (front)20.110.22
1460g Tin0.42RRP by Profit Margin
1515g Tin stickers (front)0.11 % Profit80%
16 Suggested RRP£3.76
17 Gross profit per bar£3.01
18  Gross profit per batch£42.11
19  % Profit80%
20  
21  Profit by RRP
22  RRP£4.50
23  Gross profit per bar£3.75
24  Gross profit per batch£52.47
25  % Profit83%
26  
27  Wholesale50%
28  
29Wholesale Price
30Batch TotalPacking TotalRRP£5.00
31Gross Totalunits per batchWholesale Price£2.50
32Cost per unit£0.7520Gross Profit£1.75
33014£0.0000% Profit70%
34
35
36
Solid Lotion - Peppermint
Cell Formulas
RangeFormula
B2B2=TEXTAFTER(CELL("filename",A1),"]")
I4I4=SUM(D33+G32)
D10D10=IF(ISNA(VLOOKUP(B10,'Master Price List'!B6:F33,5,FALSE)),"",VLOOKUP(B10,'Master Price List'!B6:F33,5,FALSE))
I10:I28I10=IF(ISNA(VLOOKUP(G10:G28,'Master Price List'!$H$5:$L$22,5,FALSE)),"",VLOOKUP(G10:G28,'Master Price List'!$H$5:$L$22,5,FALSE))
M9M9=M8*I4
M10M10=M9-I4
M11M11=SUM(M10*C4)
M12,M25,M19M12=M10/M9
J10:J13,J15:J28J10=IF(OR(H10="",I10=""),"",PRODUCT(H10,I10))
M16M16=I4/(1-M15)
M17M17=M16-I4
M18M18=SUM(M17*C4)
M23M23=M22-I4
M24M24=M23*C4
E18:E28E18=IF(OR(D18="",C18=""),"",PRODUCT(C18,D18))
G32G32=SUMIF(J10:J25,"<>#N/A")
B33B33=SUMIF(E10:E25,"<>#N/A")
C33C33=SUM(C4)
D33D33=SUM(B33/C33)
M31M31=M30*M27
M32M32=M31-I4
M33M33=M32/M31
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
B34:B36List='Master Price List'!$G$6#
G10:G28List='Master Price List'!$G$6#
B10:B28List='Master Price List'!$A$6#
 
Upvote 0
Soap Costings Spreadsheet v1a.xlsm
ABCDEFGHIJKL
2
3
4IngredientsPackaging & Other
5IngredientSupplierGramCostCost per GramItemSupplierQtyCostunit cost
6Almond Oil, SweetAlmond Oil, SweetThe Soapery4600400.00869565215g tin15g tinTinware10031.20.312
7Beeswax (own)Beeswax (own)Home10000015g Tin stickers (back)15g Tin stickers (back)Evergreen goods store10.110.11
8Beeswax (SP)Beeswax (SP)The Soapery100015.950.0159515g Tin stickers (front)15g Tin stickers (front)Evergreen goods store10.110.11
9Castor Bean OilCastor Bean OilThe Soapery9608.990.00936458360g Tin60g TinTinware100420.42
10CharcoalCharcoalThe Soapery1004.650.046560g Tin Stickers (back)60g Tin Stickers (back)Evergreen goods store110.110.01
11Clay - Purple Brazilian Clay - Purple Brazilian The Soap Kitchen10011.860.118660g Tin Stickers (front)60g Tin Stickers (front)Evergreen goods store80.110.01375
12Cocoa ButterCocoa ButterThe Soapery100012.950.01295Belly Band (bar)Belly Band (bar)Evergreen goods store60.080.013333333
13Cocoa PowderCocoa PowderSainsburys2503.250.013Hourly Rate (per min)Soap Sticker (bar)Evergreen goods store120.110.009166667
14coconut oil (76, refined)coconut oil (76, refined)The Soap Kitchen500029.040.005808Soap Sticker (bar)Hourly Rate (per min)n/a60150.25
15EO LemonEO LemonFreshskin907.90.0877777780
16EO LemongrassEO LemongrassFreshskin897.950.0893258430
17EO PatchouliEO PatchouliMystic Moments50040.460.080920
18EO PeppermintEO PeppermintFreshskin858.90.1047058820
19EO Rose GeraniumEO Rose GeraniumFreshskin908.990.0998888890
20EO RosemaryEO RosemaryFreshskin908.950.0994444440
21French Clay - GreenFrench Clay - GreenMystic Moments1004.7120.047120
22French Clay - Pink French Clay - Pink Mystic Moments1004.7120.047120
23French Clay - RedFrench Clay - RedMystic Moments1004.7120.047120
24French Clay - YellowFrench Clay - YellowMystic Moments1004.7120.047120
25Gromwell RootGromwell RootMystic Moments1006.950.06950
26HoneyHoneyOwn1000
27Honey (Sains)Honey (Sains)Sainsburys3401.290.0037941180
28Jojoba OilJojoba OilThe Soapery868300.0345622120
29Kaolin ClayKaolin ClayThe Soapery10006.990.006990
30Lavender ECLavender ECFreshskin909.750.1083333330
31Mango ButterMango ButterThe Soapery500048.990.0097980
32OatsOatssainsburys100010.0010
33Olive oilOlive oilSainsburys1840110.0059782610
34Sea saltSea saltSainsburys3501.20.0034285710
35Shea Butter (refined)Shea Butter (refined)The Soapery500029.950.005990
36Sodium HydroxideSodium HydroxideThe Soapery500027.950.005590
37TumericTumericSainsburys481.10.0229166670
38Vit EVit EThe Soapery9513.90.1463157890
3900
4000
4100
4200
4300
4400
4500
4600
4700
4800
4900
5000
5100
5200
5300
5400
5500
5600
5700
5800
5900
6000
6100
6200
6300
Master Price List
Cell Formulas
RangeFormula
A6:A5000A6=SORT('Master Price List'!$B$6:$B$5000)
G6:G5000G6=SORT('Master Price List'!$H$6:$H$5000)
L6:L14L6=SUM(K6/J6)
F6:F38F6=IFERROR(SUM(E6/D6),"")
Dynamic array formulas.
 
Upvote 0
Just realised i'd been playing with code on first one but

Soap Costings Spreadsheet v1a.xlsm
ABCDEFGHIJKLMN
2Solid Lotion - Peppermint
3
4How many units of product does your Batch make?14Total Cost per item (Ingredients, Packing and other costs)£0.75
5
6
7Recipe Cost (per Batch)Packaging & Other Costs (per item)RRP by Multiply
8Ingredientsg in recipeCost per gramCost ItemQtyCost per itemCost Multiply by5
9Suggested RRP£3.76
10Clay - Purple Brazilian 20.118615g tin10.3120.312Gross Profit per bar£3.01
11Beeswax (SP)15g Tin stickers (back)10.110.11Gross Profit per batch£42.11
12Beeswax (SP)15g Tin stickers (front)10.110.11% Profit80%
1315g Tin stickers (front)20.110.22
1460g Tin0.42RRP by Profit Margin
1515g Tin stickers (front)0.11 % Profit80%
16 Suggested RRP£3.76
17 Gross profit per bar£3.01
18  Gross profit per batch£42.11
19  % Profit80%
20  
21  Profit by RRP
22  RRP£4.50
23  Gross profit per bar£3.75
24  Gross profit per batch£52.47
25  % Profit83%
26  
27  Wholesale50%
28  
29Wholesale Price
30Batch TotalPacking TotalRRP£5.00
31Gross Totalunits per batchWholesale Price£2.50
32Cost per unit£0.7520Gross Profit£1.75
33014£0.0000% Profit70%
34
Solid Lotion - Peppermint
Cell Formulas
RangeFormula
B2B2=TEXTAFTER(CELL("filename",A1),"]")
I4I4=SUM(D33+G32)
D10D10=IF(ISNA(VLOOKUP(B10,'Master Price List'!B6:F33,5,FALSE)),"",VLOOKUP(B10,'Master Price List'!B6:F33,5,FALSE))
I10:I28I10=IF(ISNA(VLOOKUP(G10:G28,'Master Price List'!$H$5:$L$22,5,FALSE)),"",VLOOKUP(G10:G28,'Master Price List'!$H$5:$L$22,5,FALSE))
M9M9=M8*I4
M10M10=M9-I4
M11M11=SUM(M10*C4)
M12,M25,M19M12=M10/M9
J10:J13,J15:J28J10=IF(OR(H10="",I10=""),"",PRODUCT(H10,I10))
M16M16=I4/(1-M15)
M17M17=M16-I4
M18M18=SUM(M17*C4)
M23M23=M22-I4
M24M24=M23*C4
E18:E28E18=IF(OR(D18="",C18=""),"",PRODUCT(C18,D18))
G32G32=SUMIF(J10:J25,"<>#N/A")
B33B33=SUMIF(E10:E25,"<>#N/A")
C33C33=SUM(C4)
D33D33=SUM(B33/C33)
M31M31=M30*M27
M32M32=M31-I4
M33M33=M32/M31
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
B34:B42List='Master Price List'!$G$6#
G10:G28List='Master Price List'!$G$6#
B10:B28List='Master Price List'!$A$6#
 
Upvote 0
Never mind - I've figured it... somehow automatic calculations was turned off in options!!!!! How I don't know!!!
That's 2 hours of my life I won't get back :(
 
Upvote 0
I cannot replicate your error.
What cell did you have the formula in? Assuming you have that formula in cell D10 or I10 you need to be sure all cells D11:D28 and i11:i28 are empty.

I just saw your update. I'm happy you figured it out.
 
Upvote 0
I cannot replicate your error.
What cell did you have the formula in? Assuming you have that formula in cell D10 or I10 you need to be sure all cells D11:D28 and i11:i28 are empty.

I just saw your update. I'm happy you figured it out.
Thanks so much for trying!
I've no idea why it did that, but it just did it again.... hmmmm.... shall investigate further. I've never changed those settings :(
 
Upvote 0

Forum statistics

Threads
1,215,093
Messages
6,123,068
Members
449,091
Latest member
remmuS24

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