Error in few subtraction formulas

praveenjain64

New Member
Joined
Feb 7, 2014
Messages
7
Hi,

I tried a lot of ways to fix this by TRUNC & ROUND to restrict this happening, but I am not successful.

I am using a nested formula which has a small subtraction within it.

There are few cases when the subtraction is does not works if thought I have the subtraction within TRUNC.

E.g.: 5.36 - 4.6

The simple subtraction always shows as 0.76 where as when I have nested this calculation with a TRUNC in the formula is shows the result as 0.760000000000001

I tested the formula in edit mode by pressing F9 key & the result is 0.760000000000001.

Could someone help me with this please?

-Praveen
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
May we know the formula you are using?
 
Upvote 0
Hi,

The formula is linked to 4 cells & below is the formula:

=IFERROR(IF(LEFT(C2,1)="*",CONCATENATE(C2," ",B2," ",E2),IF(ISERROR(LEN(MID(D2,SEARCH(".",D2)+1,2)))=TRUE,CONCATENATE(C2," ",UPPER(B2)," ",TRUNC(D2,2),">",TRUNC(E2,2),IF((D2-E2)/D2<=0%," ERROR",IF((D2-E2)/D2=50%," HP",IF((D2-E2)/D2<50%,CONCATENATE(" SV ",TRUNC(D2,2)-TRUNC(E2,2)),IF((D2-E2)/D2>50%," BTHP"))))),IF(LEN(MID(D2,SEARCH(".",D2)+1,2))=2,CONCATENATE(C2," ",UPPER(B2)," ",TRUNC(D2,2),">",TRUNC(E2,2),IF((D2-E2)/D2<=0%," ERROR",IF((D2-E2)/D2=50%," HP",IF(((D2-0.01)-E2)/(D2-0.01)=50%," HP",IF((D2-E2)/D2<50%,CONCATENATE(" SV ",TRUNC(D2,2)-TRUNC(E2,2)),IF(((D2-0.01)-E2)/(D2-0.01)<50%,CONCATENATE(" SV ",TRUNC(D2,2)-TRUNC(E2,2)),IF((D2-E2)/D2>50%," BTHP",IF(((D2-0.01)-E2)/(D2-0.01)>50%," BTHP")))))))),IF(LEN(MID(D2,SEARCH(".",D2)+1,2))=1,CONCATENATE(C2," ",UPPER(B2)," ",TRUNC(D2,2),">",TRUNC(E2,2),IF((D2-E2)/D2<=0%," ERROR",IF((D2-E2)/D2=50%," HP",IF((D2-E2)/D2<50%,CONCATENATE(" SV ",TRUNC(D2,2)-TRUNC(E2,2)),IF((D2-E2)/D2>50%," BTHP"))))))))),"")


In the above formula I have a text in B & C and number (price) in D & E.

I am using a TRUNC because any thing greater than .005 should be rounded down to the below number.

Please let me know if you need any more information.

Thank you :)
 
Upvote 0

Forum statistics

Threads
1,213,537
Messages
6,114,216
Members
448,554
Latest member
Gleisner2

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