Decimal places in an if statement

remin1100

New Member
Joined
Mar 11, 2020
Messages
2
Office Version
  1. 2013
Platform
  1. Windows
Hello, I am new to the forum and have an issue with the number of decimal places returned in an if statement. My formula is :
=IF(C24>0,"X"&C24&"Y"&D24,0)
C and D are both rounded to 4 decimal places.
C24 = 2.0000
D24=1.0000

The return value I get is
X2Y1


I need to have it return a value with at least 4 decimal places after both the 2 and the 1.

Any help is greatly appreciated.

 

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)
Try =IF(C24>0,"X"&TEXT(C24,"0.0000")&"Y"&TEXT(D24,"0.0000"),0)
 
Upvote 0
You're welcome and thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

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