List Query

A

aries0070

I am trying get a data from the other sheet that matches the required
field. But it gives me FALSE result. Can you please help me on this.
Thanks in advance.

This is my example:
=IF(F7='Allowances Summary'!A6:A57,'Allowances Summary'!B6:B57)
 
M

Max

Try instead in say, G7:
=INDEX('Allowances Summary'!$B$6:$B$57,MATCH(F7,'Allowances
Summary'!$A$6:$A$57,0))
Copy G7 down to retrieve data for the other values in F8, F9, etc

Alternatively, with an error trap to return blanks:"" for unmatched values
instead of ugly #N/As, you could put in G7, and copy down:
=IF(ISNA(MATCH(F7,'Allowances Summary'!$A$6:$A$57,0)),"",INDEX('Allowances
Summary'!$B$6:$B$57,MATCH(F7,'Allowances Summary'!$A$6:$A$57,0)))
 
A

aries0070

Thank you guys for your immediate reply, but it gave me a blank tha
means it didn't found anything matches that I required.

For more explanation about my request is:

A6:A57 (Is the list of Employee Names)
B6:B57 (Is the Employee ID Number)

F7 (To enter the Employee ID Number required, then when it matches an
number in B6:B57, then the Employee Name appears. Also note that F7 i
located to another sheet within that File.)

It is like using "Query" in MS Access
 
M

Max

A6:A57 (Is the list of Employee Names)
B6:B57 (Is the Employee ID Number)

F7 (To enter the Employee ID Number required, then when it matches any
number in B6:B57, then the Employee Name appears. Also note that F7 is
located to another sheet within that File.)

Think you've switched the columns A & B around in the descript above,
compared to what was inferred in your orig. post <g>

Try in say, G7 (on the same sheet as the input cell F7), either:
=INDEX('Allowances Summary'!$A$6:$A$57,MATCH(F7,'Allowances
Summary'!$B$6:$B$57,0))

or, with the error trap:
=IF(ISNA(MATCH(F7,'Allowances Summary'!$B$6:$B$57,0)),"",INDEX('Allowances
Summary'!$A$6:$A$57,MATCH(F7,'Allowances Summary'!$B$6:$B$57,0)))

If you still get no matches where there obviously should be, one guess is
that the employee id numbers in: 'Allowances Summary'!$B$6:$B$57
are text numbers while those entered in F7 are real numbers, thus throwing
the matching off.

Try this to convert: 'Allowances Summary'!$B$6:$B$57 to real numbers. Select
any empty cell and copy it. Then select / right-click on the range:
'Allowances Summary'!$B$6:$B$57 and choose Paste Special > Check "Add" > OK.
This operation will convert all the text numbers to real numbers for proper
matching. Try the above, let us know how it goes.
 
A

aries0070

Maybe I miss something using your formulas, sorry for the
inconvenience.

But I got it. I used this function.

=VLOOKUP(F7,Names,2,FALSE)

I just Named the Range A6:B57 to Names. That's all.

Thank you for your help and contributions.
 
M

Max

No prob, you're welcome. Glad to hear you got it up.

I didn't suggest VLOOKUP initially as I inferred (wrongly?) from your orig.
post that the return col was to the *left* of the lookup col, in which case
INDEX(... MATCH(...)) would be an option with the flexibility for the task
...
 
Top