excel formula to pull values from another sheet if number in one column is the same

China☆狼群 提交于 2019-12-25 18:50:00

问题


I am trying to automate an invoice and need some help. I have my invoice formatted on one tab, and all orders are entered on a separate tab. The 'Orders' tab has multiple columns -- Invoice ID, Invoice Date, Customer ID, etc. Each product within an order is entered on a new row with the same Invoice ID.

I have formulas set up in the cells on my 'Invoice' tab to grab the information from the 'Orders' tab when I simply input the Invoice ID. However, how do I modify the formula to get all the products under one Invoice ID to populate on the invoice? Below is my current formula:

=INDEX(Orders!E:E,MATCH(Invoice!$I$10,Orders!A:A,0)

Invoice ID is in cell I10 on the 'Invoice' tab and column A on the 'Orders' tab. Product ID is in column E on the 'Orders' tab.

The formula works great on the first product, but how do I get the other products with the same Invoice ID to appear on the invoice in the rows below the first item?


回答1:


try,

=INDEX(Orders!E:E, aggregate(15, 6, row($2:$999)/(Invoice!$I$10=Orders!A$2:A$999), row(1:1)))


来源:https://stackoverflow.com/questions/50336499/excel-formula-to-pull-values-from-another-sheet-if-number-in-one-column-is-the-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!