[英]Match, pull and add numbers from different cells on a different sheet
I have data on 'JobSheet1' in Column D, I have Invoice Numbers in ascending order (some are repeated for different products on same order), in Column E, I have amounts ie £50.00. 我在D列中有关于'JobSheet1'的数据,我的发票编号按升序排列(某些商品在同一订单上重复出现),在E列中,金额为£50.00。
On a second sheet 'InvoicesSheet1' in Column B, I have the invoice numbers and Column C is where I would like the total for each invoice number to appear. 在B列的第二张工作表'InvoicesSheet1'上,我有发票编号,C列是我希望每个发票编号的总计出现的位置。
Can anyone help with very simple VBA or a formula that will search for the Invoice Number its sitting by in 'JobSheet1' Column D and add all the matching invoice number totals from Column E. 任何人都可以提供非常简单的VBA或公式来帮助您在'JobSheet1'列D中搜索其发票编号并从E列中添加所有匹配的发票编号总计的公式。
Scott Craner is right, with the schema you described, you will get the result you want entering into cells Ci:Cj (where "i" and "j" are the start and end of your table, respectively): Scott Craner是正确的,使用您描述的模式,您将得到想要输入单元格Ci:Cj的结果(其中“ i”和“ j”分别是表的开始和结束):
=SUMIFS('JobSheet1'!E:E,'JobSheet1'D:D,B{i...j})
If this doesn't work, likely issues you need to watch out for would be: 如果这不起作用,则您需要注意的可能问题是:
I'd need to see your data to see what could be the issue, but that's not what this forum is for - Try constructing a new table with dummy data set up exactly as you described it here and try using this formula, to verify if it works. 我需要查看您的数据以查看可能是什么问题,但这不是该论坛的目的-尝试构造一个完全按照您在此描述的虚拟数据表,并尝试使用此公式来验证是否有用。 Then, adjust accordingly as needed.
然后,根据需要进行相应调整。
Assuming you're first invoice number in InvoiceSheet1 is in cell b3, you can use: =SUMIF(JobSheet1!D:D,InvoiceSheet1!B3,JobSheet1!E:E). 假设您是InvoiceSheet1中的第一个发票编号在单元格b3中,则可以使用:= SUMIF(JobSheet1!D:D,InvoiceSheet1!B3,JobSheet1!E:E)。
If it's in another row, replace InvoiceSheet!B3, with the relevant cell where your data starts. 如果在另一行中,请将InvoiceSheet!B3替换为数据开始的相关单元格。 Copy down the formula for the other invoices
抄下其他发票的公式
SUMIFS is not necessary with just one lookup condition. 仅使用一种查询条件就不需要SUMIFS。
I solved this by amending the SUMIFS suggestion from ScottCraner and this is what I ended up with 我通过修改ScottCraner的SUMIFS建议解决了这个问题,这就是我最终得到的结果
=SUMIFS(Jobs!K:K,Jobs!A:A,D3)+SUMIFS(Jobs!L:L,Jobs!A:A,D3) = SUMIFS(作业!K:K,作业!A:A,D3)+ SUMIFS(作业!L:L,作业!A:A,D3)
Does the job! 做工作!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.