如何根据excel中的条件替换单元格的文本 [英] How to replace text of a cell based on condition in excel
问题描述
我有以下数据分类为:
Activity_ID Employee Count
A 10
B 8
C 4
这是假设是十大排序;我想用其他字代替最后的活动值(C)而不是原始值。任何人都可以告诉我怎么做?
This is suppose to be top 10 sorting; I want to replace the last Activity value ( C ) with "other" word instead of the original value. Can anyone tell me how to do this?
推荐答案
你可以使用 IF $ c $在新单元格中的c>语句来替换文本,例如:
You can use the IF
statement in a new cell to replace text, such as:
=IF(A4="C", "Other", A4)
这将检查单元格值A4是否为C,如果是,它用其他文本替换;否则,它使用单元格A4的内容。
This will check and see if cell value A4 is "C", and if it is, it replaces it with the text "Other"; otherwise, it uses the contents of cell A4.
编辑
假设 Employee_Count
值在B1-B10中,您可以使用以下内容:
Assuming that the Employee_Count
values are in B1-B10, you can use this:
=IF(B1=LARGE($B$1:$B$10, 10), "Other", B1)
要求对数据进行排序; LARGE
功能将在系列中找到第10个最大的数字,然后其余的公式将与之相比较。
This function doesn't even require the data to be sorted; the LARGE
function will find the 10th largest number in the series, and then the rest of the formula will compare against that.
这篇关于如何根据excel中的条件替换单元格的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!