如何使用if条件将google电子表格单元格中的文本替换为另一个文本

时间:2022-01-13 20:06:27

I want to know how to change value / text in a spreadsheet cell with another I tried this "=IF(C15="100%",high,Medium)" - but no luck.

我想知道如何更改电子表格单元格中的值/文本与另一个我试过这个“= IF(C15 =”100%“,高,中)” - 但没有运气。

  • If i change the value in a cell to 100% the cell should change "100%" TO "High".
  • 如果我将单元格中的值更改为100%,则单元格应将“100%”更改为“高”。

  • If i change the value in a cell to 50% or 20% or 30% the cell should change "50%" TO "Medium".
  • 如果我将单元格中的值更改为50%或20%或30%,则单元格应将“50%”更改为“中”。

  • If i change the value in a cell to 0 the cell should change "0" TO "low".
  • 如果我将单元格中的值更改为0,则单元格应将“0”更改为“低”。

Note: the cell should be editable...

注意:单元格应该是可编辑的...

2 个解决方案

#1


Use Number → Format → Percent on the toolbar to format the values as percentages. It's better to use a range to map them.

使用工具栏上的数字→格式→百分比将值格式化为百分比。最好使用范围来映射它们。

=IF(C15>0.5, "High", IF(C15>=0.2, "Medium", "Low"))

Explanation: If cell value is greater than 50% it maps as High, else if it's greater than equal to 20% it maps as Medium, else it maps as Low.

说明:如果单元格值大于50%,则将其映射为“高”,否则如果它大于等于20%则映射为“中”,否则映射为“低”。

You need the quotes as it's a word as opposed to a number or a reference to a cell.

你需要引号,因为它是一个单词而不是数字或对单元格的引用。

#2


When you write 100% or 99% in a cell it automatically formats it as a share, i.e. 1 and 0.99, respectively.

当您在单元格中写入100%或99%时,它会自动将其格式化为共享,即分别为1和0.99。

Try the formula =if(C15=1,"High",IF(C15=0,"Low","Medium"))

尝试公式= if(C15 = 1,“高”,IF(C15 = 0,“低”,“中”))

#1


Use Number → Format → Percent on the toolbar to format the values as percentages. It's better to use a range to map them.

使用工具栏上的数字→格式→百分比将值格式化为百分比。最好使用范围来映射它们。

=IF(C15>0.5, "High", IF(C15>=0.2, "Medium", "Low"))

Explanation: If cell value is greater than 50% it maps as High, else if it's greater than equal to 20% it maps as Medium, else it maps as Low.

说明:如果单元格值大于50%,则将其映射为“高”,否则如果它大于等于20%则映射为“中”,否则映射为“低”。

You need the quotes as it's a word as opposed to a number or a reference to a cell.

你需要引号,因为它是一个单词而不是数字或对单元格的引用。

#2


When you write 100% or 99% in a cell it automatically formats it as a share, i.e. 1 and 0.99, respectively.

当您在单元格中写入100%或99%时,它会自动将其格式化为共享,即分别为1和0.99。

Try the formula =if(C15=1,"High",IF(C15=0,"Low","Medium"))

尝试公式= if(C15 = 1,“高”,IF(C15 = 0,“低”,“中”))