简体   繁体   中英

How to sum excel data in another worksheet, using the value of a reference cell

I have data in an excel worksheet that is entered daily. I have a column for week number.

In another worksheet I want to have separate rows for each week of data.

I figure I can SUM the daily data into the weekly worksheet using the value in the week number from the first spread sheet.

I can't figure out a simple formula to achieve this? Any attempt to manually enter a SUM formula and drag down, fails as the cells used increases by one rather than 7.

在此处输入图片说明

If you have the second table on Sheet2, and the one you posted is on Sheet1:

=SUMIF(Sheet1!$B:$B, Sheet2!$A2, Sheet1!$D:$D)

This formula would go in B2 of Sheet2, if the week numbers are listed in column A, starting in A2.

eg:

        A        B
1    Week No.   SUM
2      23       5795 
3      24       6204

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM