Forum Discussion
Using INDEX with SUMIFS?
OliverScheurich I think something like this could work if I finalized it a little more. How would you go about adjusting this to work across two worksheets? Also, the code names appear many times across the rows in the datasheet where I want the point values summed. Would I need to do the =F portion of this equation for every column they appear in?
=SUM(IF(INDEX('Code Sheet'!A:A,2):INDEX('Code Sheet'!A:A,ROW('Code Sheet'!A2))=A2,INDEX('Code Sheet'!B:B,2):INDEX('Code Sheet'!B:B,ROW('Code Sheet'!A2))))
This formula works across both sheets in the attached sample file. The formula has to be entered with ctrl+shift+enter in Excel versions before Office 365 or Excel for the web.
Can you attach a screenshot without sensitive data which shows how the code names appear many times across the rows in the datasheet where you want the point values summed along with the expected result? I'm unsure how the database is set up. You could as well enter sample data in the sample file and attach the file to your reply.
- jaxso915Mar 08, 2024Copper Contributor
OliverScheurich I have attached an example from my code sheet w corresponding code values and an example of how these codes appear in the other sheet, "2022" Each row in the "2022" sheet is an instance of a health inspection at a restaurant, and the codes appear each time a violation takes place within said inspection. I need to add up the point values of code violations in each row/inspection. Additionally, do I need to remove the descriptions with the codes? Just now thought about the fact that I might need to
- OliverScheurichMar 08, 2024Gold Contributor
=SUM(IF(A2:I2='Code Sheet'!$A$2:$A$9,'Code Sheet'!$B$2:$B$9))
Yes i'd remove the descriptions in the "2022" sheet because it simplifies the calculation.
- jaxso915Mar 28, 2024Copper Contributor
OliverScheurich Apologies for the late response to your reply. I have used your formula, but all I get as an output is "0". I have attached a snip of the issue. Any ideas? Thanks again for your help with this.