kumara_faith
Well-known Member
- Joined
- Aug 19, 2006
- Messages
- 922
- Office Version
- 365
Hi,
I have the following tables;
Table 2 has the raw data. This data is updated daily.
Table 1 is the summary from Table 2
In Table 3, I am trying to take the total for the latest date. Example if today is Jan 31, then the total will show 900. However, when the date changes to Feb 1 2023 in cell R2,, the total in Table 1 which is based from Table 2 will change as well. Assuming today is Feb 1 2023, an example of the new tables will look as below:
Is there a way to build a formula in Table 1 that takes the sum from Table 2 only for the respective months based on the dates in cell R2 and the figures in Table 2?
I have the following tables;
Book1 | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | |||
2 | Table 1 | Table 2 | Tuesday, 31 January, 2023 | |||||||||||||||
3 | Branch | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | Branch | Sales | |||
4 | Texas | 300 | Texas | 100 | ||||||||||||||
5 | New York | 300 | New York | 100 | ||||||||||||||
6 | Chicago | 300 | Chicago | 100 | ||||||||||||||
7 | Total | 900 | Texas | 100 | ||||||||||||||
8 | New York | 100 | ||||||||||||||||
9 | Chicago | 100 | ||||||||||||||||
10 | Texas | 100 | ||||||||||||||||
11 | Table 3 | New York | 100 | |||||||||||||||
12 | Total | 900 | Chicago | 100 | ||||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D4:D6 | D4 | =SUMIF($Q4:$Q12,C4,R4:R12) |
D7 | D7 | =SUM(D4:D6) |
D12 | D12 | =LOOKUP(2,1/(D7:O7>0),D7:O7) |
Table 2 has the raw data. This data is updated daily.
Table 1 is the summary from Table 2
In Table 3, I am trying to take the total for the latest date. Example if today is Jan 31, then the total will show 900. However, when the date changes to Feb 1 2023 in cell R2,, the total in Table 1 which is based from Table 2 will change as well. Assuming today is Feb 1 2023, an example of the new tables will look as below:
Book1 | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | |||
2 | Table 1 | Table 2 | Tuesday, 31 January, 2023 | |||||||||||||||
3 | Branch | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | Branch | Sales | |||
4 | Texas | 300 | 700 | Texas | 100 | |||||||||||||
5 | New York | 300 | 300 | New York | 100 | |||||||||||||
6 | Chicago | 300 | 300 | Chicago | 100 | |||||||||||||
7 | Total | 900 | 1300 | Texas | 500 | |||||||||||||
8 | New York | 100 | ||||||||||||||||
9 | Chicago | 100 | ||||||||||||||||
10 | Texas | 100 | ||||||||||||||||
11 | Table 3 | New York | 100 | |||||||||||||||
12 | Total | 1300 | Chicago | 100 | ||||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D7:E7 | D7 | =SUM(D4:D6) |
D12 | D12 | =LOOKUP(2,1/(D7:O7>0),D7:O7) |
Is there a way to build a formula in Table 1 that takes the sum from Table 2 only for the respective months based on the dates in cell R2 and the figures in Table 2?