Calculate values in another worksheet in excel

I have an excel worksheet that has the following data setup (sample)

Sheet image
An another worksheet I have the unique values of the b column(site Name)

I want to put in columns across the top of the second work sheet the values from the corresponding week

Site1 | week 1| week2 | Week 3   etc. ( The columns are simply numbered 1|2|3 the text week is not there)

basically the value of D where columns b on the other sheet = column a on the summary sheet and the week value on the first sheet equals the column value (or week number) on the summary sheet

Not sure how to go about this. Sheet image
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saurabh Singh TeotiaCommented:
I'm not sure how does your sheet2 data looks like where you are trying to get this data..Can you post your sample file with how does the sheet2 looks like as it becomes easier then to write a formula of what you are looking for..

NjamesRRSAuthor Commented:
This is a screen shot of ssecond summary sheet
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Something like this?
The formula in B2 of Summary Sheet is copied across and down.
Adjust the range in the formula to match it with your original Data sheet.
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

Saurabh Singh TeotiaCommented:
You can do something like this...


Open in new window

NjamesRRSAuthor Commented:

Can you break down whats happening in each section?


Why is there multiplication?
NjamesRRSAuthor Commented:
Attached is the actual file if it helps.
Saurabh Singh TeotiaCommented:
Basically it's looking for all the matches which meet your criteria and sum all the values of it..Now your data is not clean..I clean the data and it does what you are looking for..


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.