Finding Invoices Paid Out of Order

Elliottj2121

Board Regular
Joined
Apr 15, 2021
Messages
56
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello,

I am hoping someone can help me. I have a basic understanding of VBA and formulas but this problem is stumping me. I am trying to have excel find the invoices that are paid out of order by invoice date. In the condensed example below Alpha Company skipped the invoice from 10/10/2022 and 10/24/2022. However, the invoices between rows 14-16 are not skipped because there are no newer invoices paid after row 13. Beta Company did not skip any invoices. What I would like is to run a macro (or use formulas with sorting) that only would show the skipped invoices, i.e. the rows in yellow. Each company has a unique customer number, my spreadsheet has thousands of rows and the number of rows can vary day to day.

Thank you!!!

SKIP_RPT_EX.xlsx
ABCDEFGHI
1CUST #CUST NAMEINVOICE NUMBERINV DATEPAID DATEOPEN AMTPAY DAY OF YEARINVOICE DAY OF YEARPAID=1 OPEN=-1
21375ALPHA46810/09/202211/03/2022189.05307283-1
31375ALPHA47110/10/2022NULL189.050283-1
41375ALPHA94410/11/202211/03/20220.003072841
51375ALPHA57910/19/202211/03/20220.003072921
61375ALPHA6810/20/202211/03/20220.003072931
71375ALPHA74410/24/202211/03/20220.003072971
81375ALPHA4110/24/202211/03/20220.003072971
91375ALPHA36310/24/2022NULL346.730297-1
101375ALPHA50410/24/202211/03/20220.003072971
111375ALPHA95510/31/202211/03/20220.003073041
121375ALPHA44710/31/202211/03/20220.003073041
131375ALPHA32710/31/202211/03/20220.003073041
141375ALPHA15111/01/2022NULL1197.340305-1
151375ALPHA15311/01/2022NULL21511.830305-1
161375ALPHA15011/02/2022NULL693.450306-1
171200BETA67808/29/202211/03/20220.003072411
181200BETA11908/29/202211/03/20220.003072411
191200BETA91108/29/202211/03/20220.003072411
201200BETA52609/21/2022NULL10621.700264-1
211200BETA86109/21/2022NULL3829.190264-1
221200BETA95709/22/2022NULL10291.680265-1
231200BETA24009/26/2022NULL2252.560269-1
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C:CCell ValueduplicatestextNO
 
Sounds like the size of the data is causing some problems. In that case I suggest that you abandon the Conditional Formatting idea. Conditional Formatting is (super) volatile so will be placing more calculation burden on the workbook.

What about adding a helper column as I have done below in column J. Instead of filtering on colour, you can filter that column for 1.

If you really do want the CF then I have included a much simpler one in my mini sheet below using that extra column, but I don't think that really adds much over a 30,000 row data set. Anyway, you can try with/without the CF if you want.

Elliottj2121.xlsm
ABCDEFGHIJ
1CUST #CUST NAMEINVOICE NUMBERINV DATEPAID DATEOPEN AMTPAY DAY OF YEARINVOICE DAY OF YEARPAID=1 OPEN=-1Skipped
21375ALPHA4689/10/20223/11/2022189.0504307283-1 
31375ALPHA47110/10/2022NULL189.05040283-11
41375ALPHA94411/10/20223/11/202203072841 
51375ALPHA57919/10/20223/11/202203072921 
61375ALPHA6820/10/20223/11/202203072931 
71375ALPHA74424/10/20223/11/202203072971 
81375ALPHA4124/10/20223/11/202203072971 
91375ALPHA36324/10/2022NULL346.72680297-11
101375ALPHA50424/10/20223/11/202203072971 
111375ALPHA95531/10/20223/11/202203073041 
121375ALPHA44731/10/20223/11/202203073041 
131375ALPHA32731/10/20223/11/202203073041 
141375ALPHA1511/11/2022NULL1197.34440305-1 
151375ALPHA1531/11/2022NULL21511.82880305-1 
161375ALPHA1502/11/2022NULL693.45360306-1 
171200BETA67829/08/20223/11/202203072411 
181200BETA11929/08/20223/11/202203072411 
191200BETA91129/08/20223/11/202203072411 
201200BETA52621/09/2022NULL10621.69920264-1 
211200BETA86121/09/2022NULL3829.19040264-1 
221200BETA95722/09/2022NULL10291.680265-1 
231200BETA24026/09/2022NULL2252.56080269-1 
Sheet1 (2)
Cell Formulas
RangeFormula
J2:J23J2=IF(E2="NULL",IF(COUNTIFS(B$2:B$40000,B2,D$2:D$40000,">"&D2,I2:I40000,1),1,""),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:I23Expression=$J2textNO
Thank you! This looks like its going to work. I have to retool the data thats exported but this is sound.
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,224,828
Messages
6,181,210
Members
453,023
Latest member
alabaz

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