On the main sheet I have a list of names where I have successfully counted the number of times they appear on another twenty 'project' sheets in the cell range C10:C100.
On Cell B5 on every project sheet there is a figure. I want to return the sum of the figures based on how many times a particular name appears from the list on each project sheet.
For example, if john
is found to appear in range C10:C100 on the first and last project sheets, where the figure for the first is 10,000
and for the last 5,000
, the formula should return value of 15,000
.
The formula I am using is:
=SUMIF(project1!$C$10:$C$100,MAIN!B4,project1!$B$5)+SUMIF('project2'!$C$10:$C$100,MAIN!B4,'project2'!$B$5:$D$5)+SUMIF('project3'!$C$10:$C$100,MAIN!B4,'project3'!$B$5:$D$5)+SUMIF('project4'!$C$10:$C$100,MAIN!B4,'project4'!$B$5:$D$5)....and so on.
It works well if the name is at the top of the range but if it is further down the list in that range then it returns 0
.
What does it take to fix this?