# Calculate values in another worksheet in excel

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

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

i.e.
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

###### Who is Participating?

x
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.

Commented:
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..

Saurabh...
Author Commented:
This is a screen shot of ssecond summary sheet
Screen-Shot-2015-09-25-at-10.00.24-A.png
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.
NjamesRRS.xlsx
Commented:
You can do something like this...

``````=SUMPRODUCT((Data!\$B\$2:\$B\$13=\$A2)*(Data!\$C\$2:\$C\$13=B\$1)*(Data!\$D\$2:\$D\$13))
``````

Saurabh...
Example.xlsx
Author Commented:
Saurabh..

Can you break down whats happening in each section?

((Data!\$B\$2:\$B\$13=\$A2)*(Data!\$C\$2:\$C\$13=B\$1)*(Data!\$D\$2:\$D\$13))

Why is there multiplication?
Author Commented:
Attached is the actual file if it helps.
2013.xlsx
Commented:
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..

Saurabh...
2013.xlsx

Experts Exchange Solution brought to you by