lost_in_the_sauce
Board Regular
- Joined
- Jan 18, 2021
- Messages
- 128
- Office Version
- 365
- Platform
- Windows
I have an array of sales data from multiple stores (180), and the data is entered by the stores at the end of each month. It all goes into an array. However, some stores will update their numbers, and in the array it adds a new line with a date/timestamp. For example, New York has 4 entries for February 2022, with different timestamps, and I only want the last one.
Currently I am using SUMPRODUCT like this:
=SUMPRODUCT((Data!$B$2:$B$1214=$B18)*(Data!$J$1:$P$1=C$2)*(Data!$F$2:$F$1214=$A18)*(Data!$J$2:$P$1214))
where $B18 is the month, C$2 is the $ category (sales, rent, etc), $A18 is the location, and $J:$2:$P$14 is the array of number values.
I have a column G with the timestamp. I've tried MAX but it looks like it pulls everything, I just want to add the condition for the latest date that also matches the other 3 conditions.
Currently I am using SUMPRODUCT like this:
=SUMPRODUCT((Data!$B$2:$B$1214=$B18)*(Data!$J$1:$P$1=C$2)*(Data!$F$2:$F$1214=$A18)*(Data!$J$2:$P$1214))
where $B18 is the month, C$2 is the $ category (sales, rent, etc), $A18 is the location, and $J:$2:$P$14 is the array of number values.
I have a column G with the timestamp. I've tried MAX but it looks like it pulls everything, I just want to add the condition for the latest date that also matches the other 3 conditions.