Formula to find matching row value based on cells in multiple columns

ぐ巨炮叔叔 提交于 2019-12-23 13:22:15

问题


I am trying to lookup a col4 value when, in the same row, col1, col2 and col3 each match.

I referenced this SO Post as it is a similar question but that solution is not working for me.

I am searching for specific Sources, on specific Dates, with specific Statuss and want to return the corresponding Counts.

My data with examples of output required:


回答1:


May not be preferred approach and might not even give the correct answer but for anyone new to PivotTables the sooner they are comfortable with them the more effort they are likely to save themselves:

Select your dataset (A1:D16 above), Insert > Tables – PivotTable, PivotTable. Choose New Worksheet or, as here, Existing Worksheet Location F1. Drag the fields from the upper box into the smaller boxes as shown. The rest is just formatting, unless complicated by specific requirements for treatment of Src All.




回答2:


To use INDEX() and MATCH() with multiple lookup fields, you must commit it as an array formula. Use nested IF() statements to select for each criteria. You have to push CTRL+SHIFT+ENTER to enter a formula as an array formula.

=INDEX(col4,
    MATCH(criteria1,
        IF(col2=criteria2,
        IF(col3=criteria3,
    col1
        )), 
    0)
)

If you entered it correctly with CTRL+SHIFT+ENTER, you will see curly braces around the formula { }

Also see this article from Microsoft



来源:https://stackoverflow.com/questions/19433337/formula-to-find-matching-row-value-based-on-cells-in-multiple-columns

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