Reputation: 43
I have an excel formula to return values from multiple worksheets and provide the sum of said values. My worksheets vary in year. My formula does not work if the vehicle model does not have a sheet for every year that included in my "Year" list. Many posts on here are similar, but their solutions don't seem to work for me.
=SUMPRODUCT(SUMIF(INDIRECT("'" & C24 & Year & "*'!B:B"),C4,INDIRECT("'" & C24 & Year & "*'!Z:Z")))
Not every vehicle has a sheet for every year. How can I make it return a value for the years it does have instead of getting a reference error?
Upvotes: 1
Views: 89
Reputation: 43
=SUMPRODUCT(IFERROR(SUMIF(INDIRECT("'"&C24&" "&Year&"*'!B:B"),C4,INDIRECT("'"&C24&" "&Year&"*'!Z:Z")),0))
This is the complete formula that works for my instance. Thank you for the help
Upvotes: 1