简体   繁体   English

匹配,提取和添加来自不同工作表上不同单元格的数字

[英]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: 如果这不起作用,则您需要注意的可能问题是:

  1. Sheets are not named exactly as you typed here. 工作表的名称与您在此处键入的名称不完全相同。 Maybe they have a leading or trailing space. 也许他们有领先或落后的空间。
  2. Your copy of Excel/Windows may be set with a different regional setting, which requires that formula parameters be separated by semicolons (;) instead of comas. 您的Excel / Windows副本可能设置了不同的区域设置,这要求公式参数用分号(;)而不是逗号分隔。
  3. Your invoice numbers may not be typed precisely the same in the two different formulas. 您的发票编号在两个不同的公式中可能输入的不完全相同。
  4. Your amounts in column E may not be stored as numeric values. 您在E栏中的金额可能不会存储为数值。 You can test for this by selecting a few values from column E - if excel doesn't show their sum and average in the bottom right corner, they are stored as text and you can't perform math operations on them. 您可以通过从E列中选择一些值进行测试-如果excel在右下角未显示其总和和平均值,则它们将以文本形式存储,并且您无法对其进行数学运算。

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.

相关问题 从工作表1复制到工作表4中不同单元格的单元格范围 - Range of Cells from sheet 1 copied to sheet 4 in different cells 根据 ID 从不同的工作表中提取数据 - Pull data from different sheet based on ID 我可以通过索引匹配或Hlookup从不同的工作表中提取迷你图 - Can I pull sparkline from a different sheet via Index Match or Hlookup 从工作表中的不同单元格中选择数据 - Data picking from different cells within sheet 在VBA中填充不同工作表中的单元格 - Populating cells from a different sheet in VBA 匹配不同工作表中的 2 列,并将第三列从一张工作表复制到另一张工作表中以匹配单元格 - Match 2 columns in different sheets and copy 3rd column from one sheet into another for matched cells 在Excel中(从vb.net运行),我可以将一张工作表中所有单元格的值添加到另一张工作表中的单元格中吗? - in excel, running from vb.net, can I add the values of all the cells in one sheet to the cells in a different sheet? 使用VBA比较不同工作表中的单元格并在单元格不匹配时在一张工作表上插入新行 - Using VBA To Compare Cells From Different Sheets And Insert New Row On One Sheet When Cells Don't Match 复制和匹配来自不同工作表的列 - Copy and match columns from different sheet 某些VLOOKUP,HLOOKUP,MATCH和INDEX组合可以将来自不同格式的表中的数据提取到一个摘要表中 - Some VLOOKUP, HLOOKUP, MATCH and INDEX combination which can pull the data from tables in different format into one summary sheet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM