# A rather involved IF function!

##### New Member
Hi Again,

Struggling to come up with a solution to the following.

Im looking to create an IF formula for the following situation.

If another worksheet has the same value as the current worksheet then display the corresponing cell value of the other worksheet that lies in that row. The range of data to look up is say the whole of column C and then the output consists of the matching results in column A.

So there is a lot of data in each rows and need to output all of the matching entries.

Is this possible, any help would be most appreciated.

### Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

#### Daveydoodles

##### Board Regular
It sounds like you are looking for a lookup function.

If the values in the first sheet that you want to find are in column A, and you want to find them in column C of the second sheet and return the corresponding value from column A of that second sheet, use;

INDEX(Sheet2!A:A,MATCH(Sheet1!A1,Sheet2!C:C,0))

##### New Member
It sounds like you are looking for a lookup function.

If the values in the first sheet that you want to find are in column A, and you want to find them in column C of the second sheet and return the corresponding value from column A of that second sheet, use;

INDEX(Sheet2!A:A,MATCH(Sheet1!A1,Sheet2!C:C,0))

Hi again,

I have tried the following Index but doesn't seem to be given an output, I have attached the formula I am using and the source:

{=INDEX(\$A\$2:\$C\$7, SMALL(IF(\$B\$9=\$A\$2:\$A\$7, ROW(\$A\$2:\$A\$7)-MIN(ROW(\$A\$2:\$A\$7))+1, ""), ROW(A1)),COLUMN(A1))}

It is exactly the same as in the source but doesn't seem to be working?

Source: http://www.get-digital-help.com/2009/10/25/how-to-return-multiple-values-using-vlookup-in-excel/</SPAN>

I tried INDEX(Sheet2!A:A,MATCH(Sheet1!A1,Sheet2!C:C,0)) also and that doesn't work plus don't think it would be suitable as I need to consider multiple matches.

Any help would be most appreciated

#### Jubjab

##### Well-known Member
Did you enter the array formula correctly? I.e. without the curly brackets and confirm formula with CTRL-SHIFT-ENTER ?

##### New Member
Did you enter the array formula correctly? I.e. without the curly brackets and confirm formula with CTRL-SHIFT-ENTER ?

Fantastic many thanks for that, will I always have to use that to run it?

#### Jubjab

##### Well-known Member
Array formulas are always entered like that, but once it is entered, you don't need to do anything for it to "run".

Replies
1
Views
106
Replies
3
Views
151
Replies
1
Views
95
Replies
0
Views
204
Replies
1
Views
206

1,147,823
Messages
5,743,405
Members
423,792
Latest member
travisds

### 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.

### Which adblocker are you using?

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

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