简体   繁体   English

如何在Excel中创建一个公式来比较单元格中的文本并返回百分比

[英]How do I create a formula in excel that compares text in cells and returns a percentage

I have a excel spreadsheet that every cell will have either three values, Pass, Fail or na(not available). 我有一个Excel电子表格,每个单元格都有三个值,通过,失败或na(不可用)。 This is an example of what the spreadsheet will look like 这是电子表格外观的一个示例

So I will like to have a formula that will compare all the cells and returned 100% "completion" when all the cells have "Pass" on them. 因此,我希望有一个公式可以比较所有单元格,并且当所有单元格上都带有“ Pass”时返回100%的“ completion”。

Use COUNTIF(): 使用COUNTIF():

=COUNTIF(A1:A10,"Pass")/COUNTIFS(A1:A10,"<>na")

Then format the output cell as Percentage. 然后将输出单元格格式设置为“百分比”。

This will return the percentage of cells that have "Pass" in them out of all the cells that are not na in A1:A10 (1) . 这将返回在A1:A10 (1)中不是na的所有单元格中具有“通过”的单元格的百分比。

在此处输入图片说明


(1) As your picture does not include row and column references, I put a general range in my formula, you will want to change the range reference to those of the range to be tested. (1)由于您的图片不包含行和列引用,因此我在公式中放置了一个常规范围,因此您需要将范围引用更改为要测试的范围。

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

相关问题 Excel:如何创建一个公式来对动态范围的单元格求和? - Excel: How do I create a formula to sum a dynamic range of cells? 如何排除公式返回零的单元格? - How do I exclude cells where the formula returns zero? 如何使Excel公式跳过空单元格 - How do I make an excel formula skip empty cells 如何在excel中创建if-then公式以生成书面答案? - How do I create an if-then formula in excel that produces a written text answer? 如何根据 VBA 或 Excel 公式中的单元格内容连接具有变化值的静态公式? - How do I CONCAT a static formula with a changing value based on a cells contents in VBA or an Excel formula? 如何在Excel中创建一个带有公式的链接到另一个工作簿? - How do I create a link in Excel, with a formula in it, to another Workbook? 如何使用公式将文本附加到Excel中的整数? - How do I append text to an integer in Excel using a formula? 如何使用EXCEL公式从一列单元格中提取具有特定模式的文本? - How can I extract a text that has a specific pattern from a column of cells using EXCEL formula? 如果某些单元格未填充,我如何更正公式tat有多个IF语句返回“ #VALUE!”? - How do i correct a formula tat has multiple IF statements that returns “#VALUE!” when certain cells are not populated? 如何在Excel单元格中包含百分比 - How to include percentage in excel cells
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM