DIV and VALUE error on IF ABS statement

Helloitsme

New Member
Joined
Feb 19, 2021
Messages
34
Office Version
  1. 365
Platform
  1. Windows
I'm having a couple issues with formulas which i'm not smart enough to solve, I hope someone will be able to help me, I've added the minisheet at the end of this wall of text
smile.gif
K to N is filled manually.

Error:
Q displays error "VALUE" if K or M is N/A, Q should remain blank in this case

Explanation
O is the average of K and M with round 0, formula =IF(COUNTA(K4;M4)=2;ROUND(AVERAGE(K4;M4);0);"")
Q is the difference between K and M with ABS, IF=0 leave blank, formula IF(ABS([K]-[M])=0;"";ABS([K]-[M]))

---------

Error:
P displays error DIV/0 if L and N is blank, P should remain blank in this case
R displays error VALUE if L or N is N/A, R should remain blank in this case

Explanation
P is the average of L and N with round 1 decimal, add /10 to the end, formula =ROUND(AVERAGE(L4;N4);1)&"/10"
R is the difference between L and N with ABS, IF=0 leave blank, formula IF(ABS([L]-[N])=0;"";ABS([L]-[N]))

Hope everyone has a great weekend!

Pricebook14JAN22.xlsx
KLMNOPQR
1CGRCGTCMCRCMCTARATSRDTD
2 #DIV/0!  
3N/AN/A614.8614,8/10#VALUE!#VALUE!
46171403.51015,3/10793.5
5577475.2526,1/10101.8
Listings
Cell Formulas
RangeFormula
O2:O5O2=IF(COUNTA(K2,M2)=2,ROUND(AVERAGE(K2,M2),0),"")
P2:P5P2=ROUND(AVERAGE(L2,N2),1)&"/10"
Q2:R5Q2=IF(ABS(K2-M2)=0,"",ABS(K2-M2))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
R1:R89Cell Valuebetween 4,1 and 10textNO
R1:R89Cell Valuebetween 2,1 and 4textNO
R1:R89Cell Valuebetween 0 and 2textNO
Q1:Q89Cell Valuebetween 51 and 500textNO
Q1:Q89Cell Valuebetween 21 and 50textNO
Q1:Q89Cell Valuebetween 0 and 20textNO
 

Attachments

  • Screenshot 2022-01-14 at 18.16.49.png
    Screenshot 2022-01-14 at 18.16.49.png
    123.4 KB · Views: 10

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I worked it out. DIV error could be fixed with IFERROR statement: =IFERROR(ROUND(AVERAGE(M2;O2);1)&"/10";"")
Value Error fixed with: =IF(OR(L3="";N3="");"";IFERROR(ABS(L3-N3);""))
 
Upvote 0
.. or you could have continued with the 'COUNT' idea used in column O, but COUNT, not COUNTA. The advantage of this is that it would not hide other errors that you might actually want to know about. :)
Examples:

In P2: =IF(COUNT(L2;N2);ROUND(AVERAGE(L2;N2),1)&"/10";"")
In Q3: =IF(COUNT(K3;M3)=2;IF(ABS(K3-M3)=0;"";ABS(K3-M3));"")
 
Upvote 0
Solution
.. or you could have continued with the 'COUNT' idea used in column O, but COUNT, not COUNTA. The advantage of this is that it would not hide other errors that you might actually want to know about. :)
Examples:

In P2: =IF(COUNT(L2;N2);ROUND(AVERAGE(L2;N2),1)&"/10";"")
In Q3: =IF(COUNT(K3;M3)=2;IF(ABS(K3-M3)=0;"";ABS(K3-M3));"")
This was exactly the solutions I looked for, and no extra errors occoured after I implemented these two so I'm very content! Thank you Peter :)
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,224
Members
452,620
Latest member
dsubash

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