Returning most recent billed amount great than zero.

DrTheoRio

New Member
Joined
Feb 29, 2024
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
I'm trying to come up with a formula that will return the most recent billed amount for a customer that is greater than zero. From the example data in the attached screenshot, a formula for column D that would result in 120 being returned for cells D5 & D6, and 12 for cell D11. Any help would be greatly appreciated.
RecentBilled.JPG
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
your profile says 2016 version, so maxifs() wont be available

=MAX(IF($A$2:$A$1000=A2,$C$2:$C$1000))
use control+shift+enter to get {}

you say greater than zero - if only zero in the list - what do you want to report
If negative only what do you want to report

if you have 2019 version or later then
MAXIFS()

Book11
ABCD
1
2a111
3a211
4b312
5b412
6b512
7c68
8c78
9c88
10d910
11d1010
12a1111
13b1212
Sheet1
Cell Formulas
RangeFormula
D2:D13D2=MAX(IF($A$2:$A$1000=A2,$C$2:$C$1000))
 
Upvote 0
Welcome to the MrExcel board!

For the future , I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with. :)

Perhaps this?
It assumes that the dates for each customer are in ascending order like your samples.

24 03 01.xlsm
ABCD
273Aug-214545
373Sep-218080
473Oct-21120120
573Nov-210120
673Dec-210120
780Aug-215555
880Sep-219999
980Oct-215656
1080Nov-211212
1180Dec-21012
1231Aug-215555
1331Sep-216565
1431Oct-21120120
1531Nov-214040
1631Dec-213535
Last billed
Cell Formulas
RangeFormula
D2:D16D2=INDEX(C:C,AGGREGATE(14,6,ROW(C$2:C2)/((A$2:A2=A2)*(C$2:C2>0)),1))


Or if a customer might have nothing billed in the first month (or more) try something like this.

24 03 01.xlsm
ABCD
273Aug-210 
373Sep-218080
473Oct-21120120
573Nov-210120
673Dec-210120
780Aug-210 
880Sep-210 
980Oct-215656
1080Nov-211212
1180Dec-21012
1231Aug-215555
1331Sep-216565
1431Oct-21120120
1531Nov-214040
1631Dec-213535
Last billed (2)
Cell Formulas
RangeFormula
D2:D16D2=IFERROR(INDEX(C:C,AGGREGATE(14,6,ROW(C$2:C2)/((A$2:A2=A2)*(C$2:C2>0)),1)),"")
 
Upvote 0
Solution
Thank you for all of your help, I greatly appreciate it. I continue to be amazed by the power of excel and the knowledge base here. All the best to you and I will figure out how to use mini-sheets.
-T
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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