Excel - 搜索列以查找文本是否匹配和计数字符串 [英] Excel - Search through a column to find if text matches and count string

查看:238
本文介绍了Excel - 搜索列以查找文本是否匹配和计数字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将值从1个工作表添加到另一个。



第一个工作表(2011年11月)只包含名称&状态,但是重复名称,并且需要在第二个工作表(销售)上添加一个字符串的百分比。



2011年11月

  AB 
1姓名状态
2 McDonalds已完成
3 McDonalds Won
4汉堡王元
5汉堡王元
6 Wendys已完成
7 iHop已完成
8 iHop已完成
pre>

第二个工作表(Sales)包含3列Name,Completed&韩元。但是,名称已删除重复项。



销售

  ABC 
1名称已完成Won
2 McDonalds
3汉堡王
4 Wendys
5 iHop

我希望销售工作表看起来像然而,这样做:

  ABC 
1名称已完成Won
2 McDonalds 50%50%
3汉堡王0%100%
4 Wendys 100%0%
5 iHop 100%0%

只是想知道要使用什么公式?它需要检查这个名字。

解决方案

我会使用 countif 功能查找销售数量和 countifs 查找号码获胜并完成。

  = COUNTIFS('2011年11月'!$ A:$ A,A2,2011年11月! $ B:$ B,won)
/ COUNTIF('2011年11月'$ A:$ A,A2)

如果格式化了赢得,则会给出比率或百分比。


I want to add values from 1 worksheet to another.

The first worksheet ("November 2011") simply contains name & status, names are however duplicated and a percentage of a string needs to be added on the second worksheet ("Sales").

e.g. "November 2011"

    A           B
1   Name        Status
2   McDonalds   Completed
3   McDonalds   Won
4   Burger King Won
5   Burger King Won
6   Wendys      Completed
7   iHop        Completed
8   iHop        Completed

The second worksheet ("Sales") contains 3 columns Name, Completed & Won. However, Name has had duplicates removed.

e.g. "Sales"

    A           B           C
1   Name        Completed   Won
2   McDonalds   
3   Burger King 
4   Wendys      
5   iHop    

I want the "Sales" worksheet to look like this however:

    A           B           C
1   Name        Completed   Won
2   McDonalds   50%         50%
3   Burger King 0%          100%
4   Wendys      100%        0%
5   iHop        100%        0%

Just wondering what formula to use? It needs to check against the name.

解决方案

I'd use a countif function to find the number of sales and countifs to find the number of wins and completed.

=COUNTIFS('November 2011'!$A:$A, A2, 'November 2011'!$B:$B, "won") 
  / COUNTIF('November 2011'!$A:$A,A2)

This would give you the ratio or percent if formatted of the won.

这篇关于Excel - 搜索列以查找文本是否匹配和计数字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆