简体   繁体   English

EXCEL:检查是否在另一列中找到单元格文本

[英]EXCEL: Check if cell text is found in another column

I have a set of 6500 school courses that I need to "normalize" and the process is to take the exact code (ex: 23.XX510XXX) if that number is contained in a set of defined "rigorous courses" or if it is AP. 我有一组6500所学校课程,我需要对其进行“规范化”,如果该数字包含在一组已定义的“严格课程”中,或者是AP,则过程将采用确切的代码(例如:23.XX510XXX) 。 So the algorithm is like this: 所以算法是这样的:

if x is contained within X:
then x=x
else if PSO=0:
then x=23
else if (#Observed/PSO) >.5
then x=x
else x=23

But I'm not sure how to do this in excel. 但是我不确定如何在excel中做到这一点。 I tried this: 我尝试了这个:

=IF(ISERROR(VLOOKUP(C2,$L$1:$L$28,0,FALSE)),23,IF(F2=0,23,IF(G2/F2>0.5,C2,23))) = IF(ISERROR(VLOOKUP(C2,$ L $ 1:$ L $ 28,0,FALSE)),23,IF(F2 = 0,23,IF(G2 / F2> 0.5,C2,23)))

But it only returns 23 every time. 但每次仅返回23。 The way it is set up, is column C is the non-normalized number that I check against column L. Column F is the PSO indicator and column G is the #observed. 它的设置方式是C列是我对照L列检查的非标准化数字。F列是PSO指示器,G列是#observed。

The PSO and #observed is because we are willing to accept the course overall as rigorous if it was taken as AP more than 50% of the time. PSO和#observed是因为,如果超过50%的时间被选为AP,我们愿意接受该课程的严格要求。

Does anyone see where I went wrong? 有人看到我错了吗?

If anyone can explain how to do it in VBA (not just give me the code) I'd love you forever!! 如果有人可以在VBA中解释如何做(不仅给我代码),我将永远爱你!

That looks almost right but the VLOOKUP will always return an error because your "Column Index" is zero, where it should be 1 - try like this 看起来几乎是正确的,但是VLOOKUP总是会返回错误,因为您的“列索引”为零,应该为1,请尝试以下操作

=IF(ISERROR(VLOOKUP(C2,$L$1:$L$28,1,FALSE)),23,IF(F2=0,23,IF(G2/F2>0.5,C2,23)))

.....or my preference is for COUNTIF like this .....或我的首选是这样的COUNTIF

=IF(COUNTIF($L$1:$L$28,C2)=0,23,IF(F2=0,23,IF(G2/F2>0.5,C2,23)))

暂无
暂无

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

相关问题 Excel-如果在另一列中找到内容,则格式化单元格 - Excel - Format cell if content found in another column 在 Excel 检查两个单元格中的短语,如果在两个单元格中找到任何列出的单词,则需要在另一个单元格中添加该单词。 对整列重复此操作 - In Excel Check phrases in two cell and in the two cell if any listed word found,need to add the word in another cell. repeat this for entire column 如何检查单元格中的实际文本是否已经存在于Excel中的列中 - How to check if the actual text in the cell already exists in the column in excel 检查文本列A中的字符串,并返回列B中的另一个字符串-Excel - Check for string in text column A, return another string in column B - Excel Excel条件格式-根据另一个单元格值将文本插入列 - Excel conditional format-Text into column based on another cell value Excel:如果在另一列中找到匹配项,则删除文本字符串的一部分 - Excel: Remove part of text string if a match is found in another column EXCEL:如何在列中查找一个单元格值并在另一个单元格中复制找到的值 - EXCEL: How to find a cell value in column and copy the found value in another cell VBA Excel代码检查在选择中是否找到某些文本,然后更改单元格文本 - VBA Excel code to check if certain text is found in selection, then change cell text Excel列等于文本和单元格 - Excel Column Equal to Text and Cell Excel-如果特定列中的单元格包含在另一列中找到的值,则删除行 - Excel- Delete rows if a cell in a particular column contains values found in another column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM