# Error in few subtraction formulas

#### praveenjain64

##### New Member
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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

#### shg

##### MrExcel MVP
May we know the formula you are using?

#### praveenjain64

##### New Member
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 #### Aladin Akyurek

##### MrExcel MVP
Try truncing once instead of twice to see if that helps:

=TRUNC(D2-E2,2)

#### praveenjain64

##### New Member
Great.... It works Thank you so much Aladin #### Aladin Akyurek

##### MrExcel MVP
Great.... It works Thank you so much Aladin You are welcome.

Replies
2
Views
64
Replies
4
Views
58
Replies
3
Views
107
Replies
3
Views
329
Replies
0
Views
53

Threads
1,128,099
Messages
5,628,671
Members
416,332
Latest member
blkbeltmjk

### Share this page ### 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