Forum

Notifications
Clear all

Rounding a Ratio?

4 Posts
2 Users
0 Reactions
81 Views
(@esanders)
Posts: 7
Active Member
Topic starter
 

I want to display a calculated ratio to zero decimal places... i am using the following equation to calculate the ratio between two numbers found in cells A1 and B1...  =(A1/GCD(A1,B1)&":"&B1/GCD(A1,B1))

This works find for whole numbers, but if the two numbers being made a ratio of have decimals, then the ratio appears something like  2:1.00212.  And I'm wanting just the 2:1 to be displayed.

The "Round" function doesn't seem to work in this case.  Any guidance greatly appreciated as ever.

Thanks, Edward.

 
Posted : 18/08/2022 10:01 pm
Riny van Eekelen
(@riny)
Posts: 1195
Member Moderator
 

Hi Edward,

You could change the formula to this:

=TEXT(A1/GCD(A1,B1),"0")&":"&TEXT(B1/GCD(A1,B1),"0")

See if this works for you.

Riny

 
Posted : 19/08/2022 1:07 am
(@esanders)
Posts: 7
Active Member
Topic starter
 

Thanks Riny... didn't quite work... so I've done a work around FYI, in the adjacent hidden cells to the two numbers I want the ratio of, I have a =ROUND('cell',0)... then use my original equation using these new rounded numbers.  Thanks for your reply.  Edward.

 
Posted : 20/08/2022 1:58 am
Riny van Eekelen
(@riny)
Posts: 1195
Member Moderator
 

Great! Glad you worked out a solution.

 
Posted : 20/08/2022 2:17 pm
Share: