Value of Most Recant Order

*shudder*

Well-known Member
Joined
Aug 20, 2009
Messages
502
Office Version
  1. 2016
Platform
  1. Windows
Hi Guys,

I am trying to work out a formula for the value of the most recent customer order.

My initial though was to use SUMPRODUCT, however after looking myself I can't work out how to apply a condition to only sum the most recent date.

Example of data and expected results as follows:

CustomerDateProductValue
A01/01/2023Apples100
B01/01/2023Pears50
A01/02/2023Apples100
A01/02/2023Oranges75
C01/03/2023Oranges20
C01/03/2023Apples100
C01/03/2023Pears200

A = 175
B = 50
C = 320

Thanks in advance.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi, perhaps some more varied example data would help a little to aid understanding, but maybe this..

Book1
ABCD
1AJan 01 2023Apples100
2BJan 01 2023Pears50
3AJan 02 2023Apples100
4AJan 02 2023Oranges75
5CJan 03 2023Oranges20
6CJan 03 2023Apples100
7CJan 03 2023Pears200
8
9A175
10B50
11C320
Sheet1
Cell Formulas
RangeFormula
B9:B11B9=SUMIFS($D$1:$D$7,$A$1:$A$7,A9,$B$1:$B$7,MAXIFS($B$1:$B$7,$A$1:$A$7,A9))
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Hi Fluff. I have updated my details. I am using office version 2016
 
Upvote 0
Hi, perhaps some more varied example data would help a little to aid understanding, but maybe this..

Book1
ABCD
1AJan 01 2023Apples100
2BJan 01 2023Pears50
3AJan 02 2023Apples100
4AJan 02 2023Oranges75
5CJan 03 2023Oranges20
6CJan 03 2023Apples100
7CJan 03 2023Pears200
8
9A175
10B50
11C320
Sheet1
Cell Formulas
RangeFormula
B9:B11B9=SUMIFS($D$1:$D$7,$A$1:$A$7,A9,$B$1:$B$7,MAXIFS($B$1:$B$7,$A$1:$A$7,A9))
Thanks, however when I try to replicate this in Excel it isn't returning any values. I have posted a simplified data set to get the general gist of what I am trying to achieve.

I am using 2016 version
 
Upvote 0
I know it can be difficult implemented suggested formulas for particular data when simple examples are given. I did try copying the data and your formula example into a new SS and all of the results were returning 0,

My data is formatted as a table and the results are on a different sheet. Expanded data set as below:

CustomerDateProductValue
A
01/01/2023​
Apples
100​
A
01/02/2023​
Apples
100​
A
01/02/2023​
Oranges
75​
B
01/01/2023​
Pears
50​
C
01/01/2023​
Oranges
75​
C
01/01/2023​
Apples
75​
C
01/03/2023​
Pears
75​
C
01/03/2023​
Oranges
20​
C
01/03/2023​
Apples
100​
C
01/03/2023​
Pears
200​
D
01/01/2023​
Apples
100​
D
01/01/2023​
Pears
100​
E
01/01/2023​
Oranges
50​
E
01/01/2023​
Apples
75​
E
01/01/2023​
Oranges
200​
E
01/03/2023​
Pears
100​
E
01/04/2023​
Oranges
50​
E
01/05/2023​
Grapes
500​
E
01/05/2023​
Apples
100​
E
01/05/2023​
Pears
100​
E
01/05/2023​
Oranges
100​
E
01/05/2023​
Grapes
100​
F
01/01/2023​
Oranges
50​
F
01/01/2023​
Pears
50​
F
01/01/2023​
Grapes
50​
Expected Results
A
175​
B
50​
C
320​
D
200​
E
800​
F
150​
 
Upvote 0
How about
Fluff.xlsm
ABCDEFGH
1CustomerDateProductValue
2A01/01/2023Apples100A175
3A01/02/2023Apples100B50
4A01/02/2023Oranges75C395
5B01/01/2023Pears50D200
6C01/01/2023Oranges75E900
7C01/01/2023Apples75F150
8C01/03/2023Pears75
9C01/03/2023Oranges20
10C01/03/2023Apples100
11C01/03/2023Pears200
12D01/01/2023Apples100
13D01/01/2023Pears100
14E01/01/2023Oranges50
15E01/01/2023Apples75
16E01/01/2023Oranges200
17E01/03/2023Pears100
18E01/04/2023Oranges50
19E01/05/2023Grapes500
20E01/05/2023Apples100
21E01/05/2023Pears100
22E01/05/2023Oranges100
23E01/05/2023Grapes100
24F01/01/2023Oranges50
25F01/01/2023Pears50
26F01/01/2023Grapes50
27
Data
Cell Formulas
RangeFormula
H2:H7H2=SUMIFS($D$2:$D$100,$A$2:$A$100,G2,$B$2:$B$100,MAX(IF($A$2:$A$100=G2,$B$2:$B$100)))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,091
Messages
6,123,062
Members
449,089
Latest member
ikke

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