Formula Showing #Value

ianharper68

New Member
Joined
May 16, 2024
Messages
26
Office Version
  1. 2021
Platform
  1. MacOS
Hi All ....

I have the following formula and it works fine except in blank cells can anybody help please:

=IF(Q8=0,"-",INDEX(Calculations!$C$13:$E$13,XMATCH(Q8,Calculations!$C$12:$E$12,-1))*(IF(Q8<2,1,Q8)))*[@[Chargeable Days]]

Screenshot 2024-10-01 at 19.42.29.png
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Is Q8 actually blank, or is a formula returning a result of "-" or ""?
If so, I'd change the beginning of your IF statement like so:
Excel Formula:
=IF(or(Q8=0,Q8="-",Q8=""),"-",INDEX(Calculations!$C$13:$E$13,XMATCH(Q8,Calculations!$C$12:$E$12,-1))*(IF(Q8<2,1,Q8)))*[@[Chargeable Days]])
 
Upvote 0
Is Q8 actually blank, or is a formula returning a result of "-" or ""?
If so, I'd change the beginning of your IF statement like so:
Excel Formula:
=IF(or(Q8=0,Q8="-",Q8=""),"-",INDEX(Calculations!$C$13:$E$13,XMATCH(Q8,Calculations!$C$12:$E$12,-1))*(IF(Q8<2,1,Q8)))*[@[Chargeable Days]])
I have just tested it and unfortunately it doesn't work :(
 
Upvote 0
We can't see your column and row labels with the picture. Can you upload some of your data using XL2BB?
 
Upvote 0
@ianharper68 I looked at your previous post and you are creating a compounding problem for yourself.
You don't want to be inserting a "-" in what is intended to be a numeric data column (field).

Go back to your Total Kgs column G in your previous thread and change the column format to something like Custom > General;[Red] General ;"-"
or #,##0.##;[Red] - #,##0.## ;"-" (put in as many ## after the decimal as you think you will need).
Change to dashes to 0 (the custom format will display it as "-")
Change the formula to
Excel Formula:
=IF(OR(G5=0,G5=""),0,INDEX(H5:O5,XMATCH(G5,$H$4:$O$4,-1))*(IF(G5<50,1,G5)))

In the above change the format of both columns to Custom > _-[$£] * #,##0.00_-;-[$£] * #,##0.00_-;_- * "-"??_-;_-@_-
In Domestic Handling In charges, if you have a formula in that column returning "" change that to 0 (without any quotes). If you have manually types in "-" then change it to 0.

In the calculation column change it to
Excel Formula:
=IF(Q8=0,0,INDEX(Calculations!$C$13:$E$13,XMATCH(Q8,Calculations!$C$12:$E$12,-1))*(IF(Q8<2,1,Q8)))*[@[Chargeable Days]]
 
Upvote 0
Highlight the area with the data, click on XL2BB > Mini Sheet.
Then paste it into a post.
 
Upvote 0
So here is the main columns that I have, there are more but XL2BB wouldn't allow me to copy more :(

Cell Formulas
RangeFormula
P44:P57P44=M44*N44*O44/1000000
Q44:Q57Q44=(M44*N44/2.45)/10000
AB44:AB57AB44=Dashboard!$Q$27
AC44:AC57AC44=$AC$3
AD44:AD57AD44=IF(AA44="","",AB44-AA44-AC44)
AE44:AE57AE44=IF(T44="NO",IF(S44=0,"-",INDEX(Calculations!$C$5:$J$5,XMATCH(S44,Calculations!$C$4:$J$4,-1))*(IF(S44<50,1,S44))),IF(S44=0,"-",INDEX(Calculations!$C$28:$J$28,XMATCH(S44,Calculations!$C$27:$J$27,-1))*(IF(S44<50,1,S44))))
AF44:AF57AF44=IF(S44=0,"-",AE44*Calculations!$M$5)
AG44:AG57AG44=IF(T44="NO",IF(S44=0,"-",INDEX(Calculations!$C$9:$J$9,XMATCH(S44,Calculations!$C$8:$J$8,-1))*(IF(S44<50,1,S44))),IF(S44=0,"-",INDEX(Calculations!$C$32:$J$32,XMATCH(S44,Calculations!$C$31:$J$31,-1))*(IF(S44<50,1,S44))))
AH44:AH56AH44=IF(Q44=0,0,INDEX(Calculations!$C$13:$E$13,XMATCH(Q44,Calculations!$C$12:$E$12,-1))*(IF(Q44<2,1,Q44)))*[@[Chargeable Days]]
AH57AH57=IF(Q57=0,0,INDEX(Calculations!$C$13:$E$13,XMATCH(Q57,Calculations!$C$12:$E$12,-1))*(IF(Q57<2,1,Q57)))*Tabela1[@[Chargeable Days]]
W48:W57W48=V48*0.15+V48
Cells with Data Validation
CellAllowCriteria
T44:T56ListYES,NO
 
Upvote 0
Which column is "Chargeable Days" on a line that has the #Value error what is in that column as the value ?
Is it "-" ?
I would change the formula in those columns to return 0 instead of "-" and use custom formatting to make it look like "-".

To try and prove that is the issue you could try this:
Rich (BB code):
=IF(Q44=0,0,INDEX(Calculations!$C$13:$E$13,XMATCH(Q44,Calculations!$C$12:$E$12,-1))*(IF(Q44<2,1,Q44)))*N([@[Chargeable Days]])
(wrapping Chargeable days in N() will force it to be zero if it is not numeric.)
 
Upvote 0
Chargeable days column is Z

That works fine and the error in the empty cells disappears :). However I have noticed I made and initial error in the original calculation. I have two charges based on ADR and Non ADR (Dangerous Goods). In the Collection Charges and Handling Charges the formulas I have work perfect. The Storage charges however needs to reflect the ADR (Column T) then if the is No there is one charge (Calculations!$C$13:$E$13,XMATCH(Q8,Calculations!$C$12:$E$12) non ADR and then Yes (Calculations!$C$36:$E$36,XMATCH(Q8,Calculations!$C$35:$E$35) for ADR then it needs to times the Chargeable Days (Column Z)

I am useless with formulas and can't work it out :(

New EDCR Master Worksheet FINAL.xlsx
LMNOPQRSTWXYZAAABACADAEAFAGAH
7COLLIE L WH CBM LDM NTW GRW ADR PODCOCOur Collection Order Ref:Label NumberDate Goods InDate Goods outFree DaysChargeable DaysDomestic Collection ChargesFSC %Domestic Handling In ChargesDomestic Storage Charges
814733330.050.0616.5016.50YESYesYesJ240317/01126/8/2410/4/24336$ 30.00$ 4.50$ 6.00$ 54.00
9118738290.210.2919.0019.00NOYesYesJ240317/02227/8/2410/4/24335$ 20.00$ 3.00$ 4.00$ 52.50
1012424170.010.026.756.75NOYesYesJ240317/03327/8/2410/4/24335$ 20.00$ 3.00$ 4.00$ 52.50
1118060730.350.20477.00477.00NOYes427/8/2410/4/24335$ 133.56$ 20.03$ 28.62$ 52.50
1218060730.350.20477.00477.00NOYes527/8/2410/4/24335$ 133.56$ 20.03$ 28.62$ 52.50
131235226733.882.17421.00421.00NOYesYesJ240317/04627/8/2410/4/24335$ 117.88$ 17.68$ 25.26$ 197.27
141110100800.880.45926.00926.00NOYesYesJ240317/05727/8/2410/4/24335$ 240.76$ 36.11$ 46.30$ 52.50
1512424170.010.023.003.00NOYes829/8/2410/4/24333$ 20.00$ 3.00$ 4.00$ 49.50
1613232190.020.0417.0017.00NOYesYesJ240317/06929/8/2410/4/24333$ 20.00$ 3.00$ 4.00$ 49.50
17112555820.560.28180.00180.00NOYesYesJ240317/071029/8/2410/4/24333$ 54.00$ 8.10$ 12.60$ 49.50
181100100500.500.4165.0065.00NOYesYesJ240317/081129/8/2410/4/24333$ 20.80$ 3.12$ 5.20$ 49.50
191150802202.640.49106.00106.00NOYes1229/8/2410/4/24333$ 31.80$ 4.77$ 7.42$ 49.50
201150802202.640.49106.00106.00NOYes131/9/2410/4/24330$ 31.80$ 4.77$ 7.42$ 45.00
21123723518210.142.27915.00915.00NOYesYesJ240317/09142/9/2410/4/24329$ 237.90$ 35.69$ 45.75$ 171.40
221117102951.130.49500.00500.00NOYesYesJ240317/10153/9/2410/4/24328$ 130.00$ 19.50$ 25.00$ 42.00
MASTER SHEET
Cell Formulas
RangeFormula
P8:P22P8=M8*N8*O8/1000000
Q8:Q22Q8=(M8*N8/2.45)/10000
AB8:AB22AB8=Dashboard!$Q$27
AC8:AC22AC8=$AC$3
AD8:AD22AD8=IF(AA8="","",AB8-AA8-AC8)
AE8:AE22AE8=IF(T8="NO",IF(S8=0,"-",INDEX(Calculations!$C$5:$J$5,XMATCH(S8,Calculations!$C$4:$J$4,-1))*(IF(S8<50,1,S8))),IF(S8=0,"-",INDEX(Calculations!$C$28:$J$28,XMATCH(S8,Calculations!$C$27:$J$27,-1))*(IF(S8<50,1,S8))))
AF8:AF22AF8=IF(S8=0,"-",AE8*Calculations!$M$5)
AG8:AG22AG8=IF(T8="NO",IF(S8=0,"-",INDEX(Calculations!$C$9:$J$9,XMATCH(S8,Calculations!$C$8:$J$8,-1))*(IF(S8<50,1,S8))),IF(S8=0,"-",INDEX(Calculations!$C$32:$J$32,XMATCH(S8,Calculations!$C$31:$J$31,-1))*(IF(S8<50,1,S8))))
AH8:AH22AH8=IF(Q8=0,0,INDEX(Calculations!$C$13:$E$13,XMATCH(Q8,Calculations!$C$12:$E$12,-1))*(IF(Q8<2,1,Q8)))*N([@[Chargeable Days]])
Cells with Data Validation
CellAllowCriteria
T8:T22ListYES,NO
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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