Return value based on multiple tests

Weaseltron

New Member
Joined
Jan 24, 2017
Messages
4
Hi all

This might be a simple request but I cant think of a neat way to do it.

Lets say I have the following table A:

Attachment Name
Value1
Value2
Value3
Value4
Value5
file1
10
15
20
0
50
file2
20
25
25
10
10
file3
25
50
50
5
0

<tbody>
</tbody>

and table B

Client Name
Value1
Value2
Value3
Value4
Value5
Attachment to be used
ClientA
10
15
20
0
50
?
ClientB
20
252510
10
?​
ClientC
30
15
15
15
15
?

<tbody>
</tbody>

What I am trying to do is find a formula to populate the "Attachment to be used" column.

This will need to compare the Value1, Value2 etc fields for each client to the Value1, Value2 etc fields for each attachment file and select the one that matches. It must be a 100% match for each value.

IF the values for a client match exactly the values for a particular attachment it should return that file name (ClientA = file1, ClientB = file2)
IF the vales for a client do not match exactly to an attachment it should return "no match" or something similar (ClientC)

Thanks in advance!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
To make it clearer, there could be multiple attachments with the same value for, say, Value1. The formula in table B will have to return the attachment name based on an exact match for every Value.
 
Upvote 0
Hi,

Here one way, Array formula to be confirm with CSE (Control, Shift, Enter), see instructions below:


Book1
ABCDEFG
1Attachment NameValue1Value2Value3Value4Value5
2file1101520050
3file22025251010
4file325505050
5
6
7Client NameValue1Value2Value3Value4Value5Attachment to be used
8ClientA101520050file1
9ClientB2025251010file2
10ClientC3015151515No Match
Sheet279
Cell Formulas
RangeFormula
G8{=IFERROR(INDEX(A$2:A$4,MATCH(B8&C8&D8&E8&F8,B$2:B$4&C$2:C$4&D$2:D$4&E$2:E$4&F$2:F$4,0)),"No Match")}
Press CTRL+SHIFT+ENTER to enter array formulas.


Formula copied down.
 
Upvote 0
Hi,

Here one way, Array formula to be confirm with CSE (Control, Shift, Enter), see instructions below:

ABCDEFG
1Attachment NameValue1Value2Value3Value4Value5
2file1101520050
3file22025251010
4file325505050
5
6
7Client NameValue1Value2Value3Value4Value5Attachment to be used
8ClientA101520050file1
9ClientB2025251010file2
10ClientC3015151515No Match

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

Array Formulas
CellFormula
G8{=IFERROR(INDEX(A$2:A$4,MATCH(B8&C8&D8&E8&F8,B$2:B$4&C$2:C$4&D$2:D$4&E$2:E$4&F$2:F$4,0)),"No Match")}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



Formula copied down.

Well thats absolutely glorious! Thank you so much, you've made my day!
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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