If contains "text string" then return highest value from key (advanced)

Batvatar

New Member
Joined
Jul 23, 2015
Messages
33
Hello all,

I have an advanced "if then" question, thank you in advanced for any help..

I have 45,000 accounts, some duplicates that had 1 piece of equipment per account... I already concatenated the information to give me 20,000 UNIQUE accounts with a cell of multiple pieces of equipment separated by commas... on Tab 2 I have a list of different pieces of equipment that have a value assigned to each piece of equipment...

What I need is a formula that will do the following... look for a piece of equipment that is on tab 2 in the concatenated information, and bring back the value of THE HIGHEST piece of equipment that is labeled on tab 2.. The trick here is that the concatenated information will have multiple matches to the equipment list on tab 2... but the values are all different.. so I need it to look at the table, and find the equipment with the HIGHEST value from tab that is matched int the concatenated info.. then I need to be able to copy that down about 20,000 times...

thanks again everyone!

Example:

Tab 2: the Key

[TABLE="width: 206"]
<tbody>[TR]
[TD]A
[/TD]
[TD]B
[/TD]
[/TR]
[TR]
[TD]Account 1
[/TD]
[TD]12
[/TD]
[/TR]
[TR]
[TD]Account 2
[/TD]
[TD]6
[/TD]
[/TR]
[TR]
[TD]Account 3
[/TD]
[TD]7
[/TD]
[/TR]
[TR]
[TD]Account 4
[/TD]
[TD]9
[/TD]
[/TR]
[TR]
[TD]Account 5
[/TD]
[TD]8
[/TD]
[/TR]
</tbody>[/TABLE]



Tab 1:(I'm trying to solve for "C")

[TABLE="width: 457"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Account 1
[/TD]
[TD]machine 1, machine 2, machine 3
[/TD]
[TD]12
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Account 2
[/TD]
[TD]machine 1, machine 2, machine 5
[/TD]
[TD]12
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Account 3
[/TD]
[TD]Machine 1, machine 3
[/TD]
[TD]12
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]Account 4
[/TD]
[TD]machine 3, machine 5
[/TD]
[TD]8
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]Account 5
[/TD]
[TD]machine 5
[/TD]
[TD]8
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Excel 2010
ABCDEF
1Account 1machine 1machine 2machine 312
2Account 2machine 1machine 2machine 512
3Account 3Machine 1machine 312
4Account 4machine 3machine 58
5Account 5machine 58
6
7
8
9Machine 112
10Machine 26
11Machine 37
12Machine 49
13Machine 58
Sheet14
Cell Formulas
RangeFormula
F1{=MAX($B$9:$B$13*COUNTIF($B1:$D1,$A$9:$A$13))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
I don't have to, I still have the original, with each piece next to each account, and duplicate account. I have a separate formula that also looks to the unique identifier of each account, and tells me in the last column if it is the last on the list.. so I can sort by that...

can we do a formula that assigns the value of the equipment in 1 line, then I can use a formula to grab the highest value on each duplicate account and apply it to the last listing of that account... then I can use my formula that assigns a "last" label to the last listing of every account?

so it may look like this? then I can just sort by my already comleted "LAST" formula, to get back to my original 20k accounts, but with a new column that has the highest value?


[TABLE="width: 885"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD](val from key)[/TD]
[TD](Last y/n)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Account 1[/TD]
[TD]machine 1[/TD]
[TD]12[/TD]
[TD]12[/TD]
[TD]no[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]account 1[/TD]
[TD]machine 2[/TD]
[TD]6[/TD]
[TD]12[/TD]
[TD]no[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]account 1[/TD]
[TD]machine 5[/TD]
[TD]8[/TD]
[TD]12[/TD]
[TD]yes[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Account 2[/TD]
[TD]machine 1[/TD]
[TD]12[/TD]
[TD]12[/TD]
[TD]no[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]account 2[/TD]
[TD]machine 2[/TD]
[TD]6[/TD]
[TD]12[/TD]
[TD]no[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]account 2[/TD]
[TD]machine 5[/TD]
[TD]8[/TD]
[TD]12[/TD]
[TD]yes[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]account 3[/TD]
[TD]machine 1[/TD]
[TD]12[/TD]
[TD]12[/TD]
[TD]no[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]account 3[/TD]
[TD]machine 3[/TD]
[TD]7[/TD]
[TD]12[/TD]
[TD]yes[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]account 4[/TD]
[TD]machine 3[/TD]
[TD]7[/TD]
[TD]7[/TD]
[TD]no[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]account 4[/TD]
[TD]machine 5[/TD]
[TD]8[/TD]
[TD]8[/TD]
[TD]yes[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]account 5[/TD]
[TD]machine 5[/TD]
[TD]8[/TD]
[TD]8[/TD]
[TD]yes[/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col span="2"></colgroup>[/TABLE]
 
Upvote 0
my table is set up where the accounts and their duplicate are in A1,A2,A3, etc, and the equipment is B1,B2, Etc.. (See below) or would you recommend using the formula as you have it outline here? I would think I would need another formula to take the account duplicates and dispurse the equipment accross B1,C1,D1 etc?
 
Upvote 0
In the key shouldn't "account" read "machine"? I think this is an easy problem to solve but your data sample seems distorted.
 
Last edited:
Upvote 0
In the key shouldn't "account" read "machine"? I think this is an easy problem to solve but your data sample seems distorted.

No it's correct, column A holds all of the accounts, call column B holds each accounts type of equipment. If there is a duplicate account in column A, it is because it is the same account but with multiple different types of equipment. So account "joes" can be listed 20 times with 20 pieces of equipment. The "Key" is on a different tab, and is just every type of equipment I have in A, and, the value of it in B.

Does that help?
 
Upvote 0
In the key Account 1 is 12, Account 2 is 6, yet in the table in post #4 Account 1 Machine 1 is 12, Account 2 Machine 1 is 12. How are you determining this?
 
Upvote 0
you are correct, sorry that is my fault, my key should read as follows; sorry for the confusion!

Tab 2: the Key

[TABLE="class: cms_table, width: 206"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]machine 1[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]machine 2[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]machine 3[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]machine 4[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]machine 5[/TD]
[TD]8[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Ok that helps a little, but why is D9 8 in my table but 7 in yours?


Excel 2010
ABCD
1Account 1machine 11212
2account 1machine 2612
3account 1machine 5812
4Account 2machine 11212
5account 2machine 2612
6account 2machine 5812
7account 3machine 11212
8account 3machine 3712
9account 4machine 378
10account 4machine 588
11account 5machine 588
12
13
14
15machine 112
16machine 26
17machine 37
18machine 49
19machine 58
Sheet15
Cell Formulas
RangeFormula
C1=VLOOKUP(B1,$A$15:$B$19,2,0)
D1{=MAX(IF($A$1:$A$11=A1,$C$1:$C$11))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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