简体   繁体   English

如何根据条件在excel的某个单元格中插入文本?

[英]How to insert text in a certain cell in excel based on conditions?

I am making an excel sheet in which I have a column which consists of percentages ranging from 60% - 90%. 我正在制作一个Excel工作表,其中有一个由60%-90%的百分比组成的列。

What I want to do is, that in each of the corresponding row of each cell in the column, I need to rate it. 我想做的是,在该列中每个单元格的对应行的每一行中,我都需要对其进行评分。

       A1     B1
A2     92%    
A3     69%    
A4     80%    

So in the above table, eg A2 is 92% - therefore in the corresponding cell it should be Proficient, whereas A3 is 69% therefore it should be Mediocre, and lastly A4 which is 80% therefore it should be average. 因此,在上表中,例如,A2为92%-因此在相应的单元格中它应为“熟练”,而A3为69%,因此应为中等,最后A4为80%,因此应为平均值。 Hence it should produce something like the following: 因此,它应产生如下内容:

       A1     B1
A2     92%   Proficient 
A3     69%   Mediocre 
A4     80%   Average

I am using Microsoft Excel, and any help would be appreciated. 我正在使用Microsoft Excel,任何帮助将不胜感激。 Can this be done in Google Sheets as well? 可以在Google表格中完成吗?

Once again thanks guys, and any help would be appreciated. 再次感谢你们,任何帮助将不胜感激。

Regards, MK 问候,MK

VLOOKUP with a match criterion of 1 instead of 0 is the classic way of solving stuff like this (you can use Excel's other lookup functions and configure them to taste, but I'll use VLOOKUP here for example's sake). 匹配条件为1而不是0的VLOOKUP是解决此类问题的经典方法(您可以使用Excel的其他查找功能并将其配置为“品尝”,但是例如,在这里我将使用VLOOKUP)。

Create a lookup table of your thresholds. 创建一个阈值查找表。 Then, supposing your lookup table is in D:E, use the following formula: 然后,假设您的查找表在D:E中,请使用以下公式:

=VLOOKUP(A2, $D$2:$E$10, 2, 1)

The match criterion of 1 searches first for an exact match. 匹配条件1首先搜索完全匹配。 If it is unable to find an exact match, then it matches on the nearest value less than the lookup value. 如果找不到完全匹配的内容,则匹配小于查询值的最接近值。

在此处输入图片说明

You can obviously fiddle with your categories as necessary. 您显然可以根据需要摆弄类别。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM