Return Latest Month Value

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
922
Office Version
  1. 365
Hi,

I have the following tables;

Book1
CDEFGHIJKLMNOPQR
2Table 1Table 2Tuesday, 31 January, 2023
3BranchJanFebMarAprMayJunJulAugSepOctNovDecBranchSales
4Texas300Texas100
5New York300New York100
6Chicago300Chicago100
7Total900Texas100
8New York100
9Chicago100
10Texas100
11Table 3New York100
12Total900Chicago100
Sheet1
Cell Formulas
RangeFormula
D4:D6D4=SUMIF($Q4:$Q12,C4,R4:R12)
D7D7=SUM(D4:D6)
D12D12=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
CDEFGHIJKLMNOPQR
2Table 1Table 2Tuesday, 31 January, 2023
3BranchJanFebMarAprMayJunJulAugSepOctNovDecBranchSales
4Texas300700Texas100
5New York300300New York100
6Chicago300300Chicago100
7Total9001300Texas500
8New York100
9Chicago100
10Texas100
11Table 3New York100
12Total1300Chicago100
Sheet1
Cell Formulas
RangeFormula
D7:E7D7=SUM(D4:D6)
D12D12=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?
 
Hi,

Thank you for all the suggestions. Just to confirm, there is no way we can retain the previous month data as the current date moves to the next month ?
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi,

I have a cross poste here:

 
Upvote 0

Forum statistics

Threads
1,215,334
Messages
6,124,319
Members
449,153
Latest member
JazzSingerNL

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top