Using MatchIndex on Multiple results to return value for the first result

Lres81715

Board Regular
Joined
Aug 26, 2015
Messages
147
I have a project where 60K records from the original worksheet have duplicate client # numbers. As in, the client placed multiple orders using the same client project key but we supplied different transaction ID's.

The client has asked for report showing the difference in MARKET price, difference in time it took to complete the order, did the transaction have different employees working on it (as in some employees searched the market price for a better deal for the client).
I need a basic formula to help me process each of these requests. A single formula that I can adapt it to meet the needs of each request. I know what needs to be done, just don't know how to start

Example
[TABLE="width: 539"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Client #[/TD]
[TD]Transaction #[/TD]
[TD]Employee #[/TD]
[TD]Transaction Value[/TD]
[TD]Time to complete order[/TD]
[/TR]
[TR]
[TD="align: left"]350[/TD]
[TD="align: right"]5000819117[/TD]
[TD="align: right"]130797[/TD]
[TD="align: left"] 128000[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: left"]350[/TD]
[TD="align: right"]5000806127[/TD]
[TD="align: right"]130797[/TD]
[TD="align: left"] 132000[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD="align: left"]407[/TD]
[TD="align: right"]5000870212[/TD]
[TD="align: right"]117615[/TD]
[TD="align: left"] 36000[/TD]
[TD="align: right"]43[/TD]
[/TR]
[TR]
[TD="align: left"]407[/TD]
[TD="align: right"]5000839178[/TD]
[TD="align: right"]117615[/TD]
[TD="align: left"] 46000[/TD]
[TD="align: right"]17[/TD]
[/TR]
[TR]
[TD="align: left"]441[/TD]
[TD="align: right"]5000869157[/TD]
[TD="align: right"]132204[/TD]
[TD="align: left"] 295000[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: left"]441[/TD]
[TD="align: right"]5000826105[/TD]
[TD="align: right"]132204[/TD]
[TD="align: left"] 305,000[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: left"]459[/TD]
[TD="align: right"]5000896841[/TD]
[TD="align: right"]131101[/TD]
[TD="align: left"] 195,000[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: left"]459[/TD]
[TD="align: right"]5000894834[/TD]
[TD="align: right"]131101[/TD]
[TD="align: left"] 195000[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: left"]641[/TD]
[TD="align: right"]5000893493[/TD]
[TD="align: right"]114280[/TD]
[TD="align: left"] 265000[/TD]
[TD="align: right"]32[/TD]
[/TR]
[TR]
[TD="align: left"]641[/TD]
[TD="align: right"]5000858570[/TD]
[TD="align: right"]132347[/TD]
[TD="align: left"] 175,000[/TD]
[TD="align: right"]24[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 539"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD="align: left"]3732[/TD]
[TD="align: right"]5000894416[/TD]
[TD="align: right"]115281[/TD]
[TD][/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: left"]3732[/TD]
[TD="align: right"]5000853163[/TD]
[TD="align: right"]115281[/TD]
[TD="align: left"]260000[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: left"]3732[/TD]
[TD="align: right"]5000815212[/TD]
[TD="align: right"]115281[/TD]
[TD="align: left"]250000[/TD]
[TD="align: right"]23
[/TD]
[/TR]
</tbody>[/TABLE]

So for Client #350, employee was the same [True], Transaction Value was [-4000], Transaction % was [3%], Time to complete difference was [-3], TTC percentage was [-25%]

Special note, The client # can be 2, 3, 4, 5 times. So the information should appear on all ROWS but the MIN Transaction ID. So in the case of Client # 3732, the information should appear on Transaction # 5000894416 AND 5000853163 but 50815212 would remain blank.
So it would look like this

[TABLE="width: 1081"]
<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Client #[/TD]
[TD]Transaction #[/TD]
[TD]Employee #[/TD]
[TD]Transaction Value[/TD]
[TD]Time to complete order[/TD]
[TD]Same Employee?[/TD]
[TD]Trans Value Difference[/TD]
[TD]Percentage[/TD]
[TD]Time to Complete Diff[/TD]
[TD]TTC Percentage[/TD]
[/TR]
[TR]
[TD="align: left"]3732[/TD]
[TD="align: right"]5000894416[/TD]
[TD="align: right"]115281[/TD]
[TD][/TD]
[TD="align: right"]5[/TD]
[TD] TRUE[/TD]
[TD="align: right"]-260000[/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: right"]-4[/TD]
[TD="align: right"]-80%[/TD]
[/TR]
[TR]
[TD="align: left"]3732[/TD]
[TD="align: right"]5000853163[/TD]
[TD="align: right"]115281[/TD]
[TD="align: left"] 260000[/TD]
[TD="align: right"]9[/TD]
[TD] TRUE[/TD]
[TD="align: right"]10000[/TD]
[TD="align: right"]4%[/TD]
[TD="align: right"]-14[/TD]
[TD="align: right"]-156%[/TD]
[/TR]
[TR]
[TD="align: left"]3732[/TD]
[TD="align: right"]5000815212[/TD]
[TD="align: right"]115281[/TD]
[TD="align: left"] 250000[/TD]
[TD="align: right"]23[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]


I've included a partial sheet to try the formula on.

https://app.box.com/s/tinglvb91u2dlristrsamrbzzw8vr8ji
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Take Same Employee as an example:

Try the formula below for a cell at row 13 under Same Employee column:

=IFERROR(IF(INDEX(C14:$C$60000,MATCH(A13,A14:$A$60000,0))=C13,TRUE,FALSE),"")

The idea is to find the next entry with the same client ID (from Row 14 to end of your total entries)
 
Upvote 0
Take Same Employee as an example:

Try the formula below for a cell at row 13 under Same Employee column:

=IFERROR(IF(INDEX(C14:$C$60000,MATCH(A13,A14:$A$60000,0))=C13,TRUE,FALSE),"")

The idea is to find the next entry with the same client ID (from Row 14 to end of your total entries)


Hmmm, let me try this and get back to you. This might just work for all instances. Thanks in advance!
 
Upvote 0
Thanks Little Excel!
This ended up working like a charm. I just modified it for each column I needed. Sum instead of If, Average, CountIf and SumIf all worked perfectly.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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