简体   繁体   English

我需要 vlookup 公式从 3 张 excel 表中提取数据

[英]I need vlookup formula to extract data from 3 excel sheets

I have a use case with excel.我有一个 excel 的用例。 I have three different excel sheets namely raw data , reference , report as below.我有三个不同的 excel 表,即raw datareferencereport如下。 Report sheet contains the total expense of each person (which needs to be calculated), reference sheet contains expense category for each person and raw data sheet contains expense name and expense value.报告表包含每个人的总费用(需要计算),参考表包含每个人的费用类别,原始数据表包含费用名称和费用值。 I need to find the total expense of each person(column B in the report sheet) using VLOOKUP or any other formula.我需要使用VLOOKUP或任何其他公式找到每个人的总费用(报告表中的 B 列)。

I need single formula to find the total expense of each person using three sheets.我需要一个公式来使用三张纸找到每个人的总费用。 I am aware of joins adn importing data in excel.我知道在 excel 中加入和导入数据。 But, I want it to be implemented with formula only.但是,我希望它只用公式来实现。

原始数据

Raw_data原始数据

参考

Reference sheet参考表

报告

Report报告

You may create column C on your Raw Data sheet by using INDEX + MATCH function to get names from column A of the your reference sheet;您可以使用 INDEX + MATCH function 在原始数据表上创建列 C 以从参考表的 A 列中获取名称;

=INDEX($A$2:$A$13,MATCH(A1,$B$2:$B$13,0),0)

In this forumula $A$2:$A$13 and $B$2:$B$13 should be selected from reference data excel while A1 should be from raw data excel.在这个论坛中,$A$2:$A$13 和 $B$2:$B$13 应该从参考数据 excel 中选择,而 A1 应该从原始数据 excel 中选择。 Then you can instert following formula to your report excel;然后您可以在报告 excel 中插入以下公式;

=SUMIFS($C$2:$C$13,$A$3:$A$13,A2)

In this formula $C$2:$C$13 and $A$3:$A$13 should come from your raw data and A2 should set for report excel.在这个公式中,$C$2:$C$13 和 $A$3:$A$13 应该来自您的原始数据,并且 A2 应该为报表 excel 设置。

I hope it is clear to you.我希望你很清楚。 Good luck.祝你好运。

Assuming you have office 365, the above can be easily done假设你有office 365,以上可以轻松搞定

=SUM(SUMIF($A$2:$A$7,FILTER($E$2:$E$7,$D$2:$D$7=G2),$B$2:$B$7))

Sample data below下面的示例数据

Sample data样本数据

Try this:尝试这个:

=SUMPRODUCT(IF(A2=RIGHT(Raw_data!A:A,1),Raw_data!B:B,0))

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

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