简体   繁体   English

如何从 Google 表格中的单元格范围向下拉列表中添加小数

[英]How to add decimals to dropdown lists from a cell range in Google Sheets

I have created a cost calculator on Google Sheets with data validation to display the values in columns Cost 1, Cost 2, Cost 3, etc. The only issue is, that when I click in the cell to display the dropdown list, it does 2 things:我在 Google 表格上创建了​​一个成本计算器,并进行数据验证,以显示成本 1、成本 2、成本 3 等列中的值。唯一的问题是,当我单击单元格以显示下拉列表时,它会显示 2事物:

  • Doesn't display the currency symbol, in this case, the dollar sign.不显示货币符号,在本例中为美元符号。
  • If a value is 20.00, 30.00 etc it just shows it as 20 or 30. If the value is 20.50, it displays 20.5.如果值为 20.00、30.00 等,则仅显示为 20 或 30。如果值为 20.50,则显示为 20.5。 If the value is 20.99 it shows it as 20.99.如果值为 20.99,则显示为 20.99。

How can I:我怎样才能:

  1. Display the currency symbol in the dropdown list在下拉列表中显示货币符号
  2. Display the exact value eg.显示确切的值,例如。 20.00 not 20 / 30.50 not 30.5 20.00 不是 20 / 30.50 不是 30.5

(1) is not essential, but (2) is preferred. (1) 不是必需的,但 (2) 是优选的。

It's worth mentioning that when an option is selected from the dropdown list, both A and B is displayed in the cell, this is about what's displayed in the dropdown.值得一提的是,当从下拉列表中选择一个选项时,单元格中会同时显示 A 和 B,这与下拉列表中显示的内容有关。

Thank you.谢谢你。

Cost 1成本 1 Cost 2费用 2 Cost 3成本 3 Selected Cost选定成本
$20.00 $20.00 $35.50 35.50 美元 $50 50 美元 $20.00 $20.00

dropdown screenshot下拉屏幕截图

data validation screenshot数据验证截图

format your range F6:H6 as Text.将您的范围 F6:H6 格式化为文本。 this way you can add $ symbol and decimals and if your dropdown is used in further calculation you can regex-out the symbol and convert it back into value这样您可以添加 $ 符号和小数,如果您的下拉列表用于进一步计算,您可以正则表达式输出符号并将其转换回值

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 根据 Google 表格中某个范围内的选定值,在下拉列表中设置值的“子范围”列表(数据验证) - Setting a “subrange” list of values in a dropdown (data validation), based on selected value from a range in Google Sheets 谷歌表:子公司和发票以及依赖的动态下拉列表 - Google sheets: Subsidiaries and invoices and dependent dynamic dropdown lists 如何根据 Google 表格中的数据验证选择从另一个选项卡自动填充范围? - How can I auto-populate a range from another tab based on a Data Validation selection in Google Sheets? 如何在 Google 表格中使用数据验证来防止将两个或更多字符放入一个单元格中? - How can I use data validation in Google Sheets to keep two or more characters from being put in a cell? Google 表格 - 从下拉列表中删除使用过的项目 - Google Sheets - Removing the used items from drop-down lists 从范围或谷歌表格中的任何数字验证数据 - Data Validation from Range OR any number in Google Sheets 谷歌表格 - 数据验证 - 使用范围列表中的公式 - Google Sheets - Data Validation - Using Formula in List from range Google表格/ Excel根据单元格值获取命名范围名称,其中多行用于相关下拉列表 - Google Sheets/Excel get named ranged name based on cell value with multiple rows for dependent dropdown Google Sheets - 用于数据验证的动态单元格范围,特别是项目标准列表 - Google Sheets - Dynamic Cell Range For Data Validation, Specifically List Of Items Criteria Google表格API V4数据验证,使用“范围列表” - google sheets API V4 data validation for range using “List from a range”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM