Home > Mobile >  Is there a way to hide decimals after a certain value in Google Sheets?
Is there a way to hide decimals after a certain value in Google Sheets?

Time:06-22

In a Google Spreadsheet, I have a price for stocks displaying. I would like to remove the decimals if the price is over $1,000. I am half way there using MROUND function and TEXT function:

=iferror(TEXT(IF(googlefinance(B2,"price")<1000,googlefinance(B2,"price"),MROUND(googlefinance(B2,"price"),1)),"$###,###.##"))

I still get the .00 at the end, or just a . for companies over $1,000. Any way anyone knows to remove this?

CodePudding user response:

Instead of using the TEXT function, how’s applying this custom number format?

[>1000]$#;[<=1000]$###,###.00

To apply a custom number format:

  1. Select the cells you want to apply it to.
  2. Format > Number > Custom number format
  3. Enter the format in the input field and click Apply.

More on the custom number format:

  • Related