If a
A1 = 24990.55
then
=INT(A1) will return 24990=MOD(A1,1) will return 0.55
You need a function to disable decimals. Int() will do this. Mod() will only show decimal points.
I do not know what behavior you expect without using functions. Just formatting the number will not change its base value. This means that there is no formatting to show only an integer value and ignore decimals without rounding. Excel does not work this way. Formatting without decimal points will always include rounding. To get around this, you need a function to cut decimal numbers.
If you want the cent to be displayed as integers, just multiply the result of Mod() by 100.

Edit: You are talking about functions above, but reading the other answers, I think that you really mean vba , UDF, or some other macro. You can get the right terminology when asking a question.
You really need to clarify what you want to achieve. Unclear.
- where do you want the exit, for example. Do you want to get the result in the same cell where the original number is entered? Where should cents go?
- Do you want the cents to be displayed as 0.55 or 55?
- If you want the values โโ(dollars and cents) to be displayed in the same cell, what does it look like?
- if you need values โโin two separate cells, indicate which cells are for dollars and which cells are for cents
Just giving generosity to a question without clearly stating your requirements doesn't help much.
Here is another approach based on the following assumptions:
- a decimal value is entered in column A
- value should be changed in column A to show only dollars (integer)
- decimal values โโwill be shown in column C
- decimal places will be shown as integers in column B
This can be achieved using the change event macro:
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("A:A")) Is Nothing Then On Error Resume Next Application.EnableEvents = False Target.Offset(0, 2) = Target - Int(Target) Target.Offset(0, 1) = (Target - Int(Target)) * 100 Target = Int(Target) Application.EnableEvents = True End If End Sub
Right-click the sheet tab, click View Code, and paste the above code into the code window.
Of course, a much simpler way to achieve exactly the same thing without functions without macros without any VBA can be performed with exactly the same number of keystrokes as entering a number in a cell.
Compare these two sets of keystrokes
2 4 9 9 0 . 5 5
from
2 4 9 9 0 Tab 5 5
A second set of keystrokes will put cents in its cell, showing them as an integer.
I would really appreciate some feedback on the many offers you received in this thread.