Index/Match not picking up nth instances in list

Ebo12

New Member
Joined
Jul 7, 2015
Messages
5
Hey everyone,

I'm currently working on a rather large report to help my executive management team identify the number of "New" vs. "Current" customers who financed with our company during 2015 (sample chart shown below). For the purpose of this sample, let's say I work for ABC Company.

Column "Analysis 1" is a helper column that I added to identify which customers are definitely current customers based on whether a date exists under "Inactive Date" that is +/- 15 days of the date under "Final Approval Date". If column "ABC Company Status" shows "active", then they are also a "current customer". Every other customer = "New Customer".

The formula that I'm currently using (and having trouble with) is under column "Current or New":
=IF([@[ABC Co. Status]]="Active", "Current Customer",IF(INDEX([Analysis 1],MATCH([@Grouping],[Grouping],0))<>"", INDEX([Analysis 1],MATCH([@Grouping],[Grouping],0)),"New Customer")).

The issue I'm running into though is that this formula doesn't pick up on instances where the entry isn't the first instance in the grouping (even if it matches the criteria)... For example, Row 7 "Jake" should be a current customer based on the "Analysis 1" designation, as should Row 19 "Katie". I have instances on my report where "Active" customers are also incorrectly labeled. I think that maybe Small could be used to solve for this.... but I'm not familiar enough with that function to know where to start with it (if it even fits at all for that matter).

Row #GroupingID #NameFinal Approval DateFile StatusLiabilityLiability Co. NameLiability Acct #ABC Co. StatusInactive DateAnalysis 1Current or New
11123456John01-30-15101st MortgageABC Company123ActiveCurrent Customer
22987654Jill04-01-15101st MortgageABC Co.456Inactive04-05-15Current CustomerCurrent Customer
32987654Jill04-01-15101st MortgageWells Fargo789Current Customer
42987654Jill04-04-15101st MortgageBMX Industrial987Current Customer
537894561Jake06-18-15101st MortgageBNY Mellon654New Customer
637894561Jake06-18-15101st MortgageBank Of America321New Customer
737894561Jake06-18-15101st MortgageABC Company135Inactive06-19-15Current CustomerNew Customer
837894561Jake06-18-15101st MortgageRochester Bank679New Customer
94654321John09-07-15101st MortgageBNY Mellon976New Customer
104654321John09-07-15101st MortgageDiscover Card523New Customer
115555555Henry10-12-15101st MortgageBank Of America741New Customer
125555555Henry10-12-15101st MortgageBMX Industrial852New Customer
135555555Henry10-12-15101st MortgageABC Co.963Inactive06-01-03New CustomerNew Customer
146222222Katie11-02-15101st MortgageQuicken Loans111New Customer
156222222Katie11-02-15101st MortgageBank of New York222New Customer
166222222Katie11-02-15101st MortgageNationstar333New Customer
176222222Katie11-02-15101st MortgageLenders Choice999New Customer
186222222Katie11-02-15101st MortgageRochester Bank888New Customer
196222222Katie11-02-15101st MortgageABC Co.777Inactive11-03-15Current CustomerNew Customer


Any suggestions on how to solve for this would be much appreciated. Thank you in advance!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi,

I can't distinguish if you want just the rows changed with the correct customer type of if it's the intention to mark all instances of the same client as New or Current.
I assumed the fist and changed your formula to this:

LM
1Analysis 1Current or New
2Current Customer

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
L2=IF(MEDIAN([@[Final Approval Date]]-15,[@[Final Approval Date]]+15,[@[Inactive Date]])=[@[Inactive Date]],"Current Customer","")
M2=IF([@[ABC Co. Status]]="Active","Current Customer",IF([@[Analysis 1]]="Current Customer","Current Customer","New Customer"))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Hope this helps.
 
Last edited:
Upvote 0
Hi Jorismoerings,

Thank you for your reply! The intent is to have the formula under Column M display the same (and correct) designation of "Current Customer"/"New Customer". Column L is a helper column that I had in there, and is working correctly for me.

Here is an example of what I need: Grouping 3 for example (which is Row # 5,6,7,8), should display "Current Customer" for each instance of the grouping # (since it is +/- 15 days, or Active). The goal is once this is fixed, I would then be able to use "Remove duplicates" in Excel and not remove the correct designation.

Does that help? Thank you again for assisting!
 
Upvote 0
Hi,

try this:

Book1
M
1Current or New
2Current Customer
Sheet1
Cell Formulas
RangeFormula
M2=IF([@[ABC Co. Status]]="Active","Current Customer",IF(COUNTIFS([ID '#],[@[ID '#]],[Name],[@Name],[Analysis 1],"")=COUNTIFS([ID '#],[@[ID '#]],[Name],[@Name]),"New Customer","Current Customer"))


NB: will only work from Excel 2007 or upwards. If you are below this version let me know; I'll rephrase.
 
Upvote 0
That worked pretty well! Thanks for that man.

Can I request a small tweak though please? Management just asked me to amend "Analysis 1" (column L) so that if [@Inactive Date]-[Final Approval Date]>=-365, "Current Customer", "New Customer".
I made the change to L to accommodate, however, now it is causing M (in instances of the same customer) to display both "New Customer" and "Current Customer" in the grouping whenever one instance of the customer is <-365, but other instances are Active or >=-365

Example (revised from the original table to illustrate):

Row #GroupingID #NameFinal Approval DateFile StatusLiabilityLiability Co. NameLiability Acct #ABC Co. StatusInactive DateAnalysis 1Current or New
22987654Jill03-01-14101st MortgageABC Co.456Inactive04-05-15New CustomerNew Customer
32987654Jill04-01-15101st MortgageABC Co.789ActiveCurrent Customer
42987654Jill04-04-15101st MortgageBMX Industrial987New Customer

I would need it to say "If one instance of Current Customer" is present in the matching group, then always Current Customer. I apologize for asking assistance again after that good fix you proposed, but do you have a suggestion for this scenario as well?

Thank you again!
 
Upvote 0
Sorry I messed up the table data. Revised below in quote:

That worked pretty well! Thanks for that man.

Can I request a small tweak though please? Management just asked me to amend "Analysis 1" (column L) so that if [@Inactive Date]-[Final Approval Date]>=-365, "Current Customer", "New Customer".
I made the change to L to accommodate, however, now it is causing M (in instances of the same customer) to display both "New Customer" and "Current Customer" in the grouping whenever one instance of the customer is <-365, but other instances are Active or >=-365

Example (revised from the original table to illustrate):

Row #GroupingID #NameFinal Approval DateFile StatusLiabilityLiability Co. NameLiability Acct #ABC Co. StatusInactive DateAnalysis 1Current or New
22987654Jill04/01/15101st MortgageABC Co.456Inactive03-01-14New CustomerNew Customer
32987654Jill04-01-15101st MortgageABC Co.789ActiveCurrent Customer
42987654Jill04-01-15101st MortgageBMX Industrial987New Customer

I would need it to say "If one instance of Current Customer" is present in the matching group, then always Current Customer. I apologize for asking assistance again after that good fix you proposed, but do you have a suggestion for this scenario as well?

Thank you again!
 
Upvote 0
hi,

That's not caused by the changes you did but is caused by the first part of the formula which looks at Active Stage. In your Sample above [Name] is now inactive and Active at same time. To solve change the formula so if any of grouped rows is Active; change to Current Customer.
See below:

M
1Current or New
2Current Customer

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
M2=IF(COUNTIFS([ID '#],[@[ID '#]],[Name],[@Name],[ABC Co. Status],"Active")>0,"Current Customer",IF(COUNTIFS([ID '#],[@[ID '#]],[Name],[@Name],[Analysis 1],"New Customer")=COUNTIFS([ID '#],[@[ID '#]],[Name],[@Name]),"New Customer","Current Customer"))

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0
Hi Jorismoerings,

I tweaked it slightly to the following (based on your earlier formula) and it worked perfectly:
=IF(COUNTIFS([ID '#],[@[ID '#]],[Name],[@Name],[ABC Co. Status],"Active")>0,"Current Customer",IF(COUNTIFS([ID '#],[@[ID '#]],[Name],[@Name],[Analysis 1],"")=COUNTIFS([ID '#],[@[ID '#]],[Name],[@Name]),"New Customer","Current Customer"))

Thank you so much for helping out on this one and best!
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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