Vlookup give strange answer

L

Legacy 245680

Guest
Hello
I'm a little noob with the case of excel, and i tried today to easier my excel with inputing Vlookup function.
On one sheet I have a list with names and surnames of my coworkers in one column (A), and their roles in team in another one (2). I want another cell to show the one person with a concrete role (it's "D\A"). I created something like that:
Code:
=VLOOKUP("D\A";A2:C34;1;TRUE)
And as the correct person is in row 8, excel puts there name and surname of the person from row 30, who have other role.
Where is the error?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Column A prob needs to be sorted if you use TRUE in your formula


If TRUE or omitted, an exact or approximate match is returned. If an exact match is not found, the next largest value that is less than lookup_value is returned.

The values in the first column of table_array must be placed in ascending sort order; otherwise, VLOOKUP may not give the correct value. You can put the values in ascending order by choosing the Sort command from the Data menu and selecting Ascending. For more information, see Default sort orders.

VLOOKUP - Excel - Office.com
 
Upvote 0
@VoG - I tried, and get #N/A error. I don't understand, why would you use reference to column 3? Names are all in column 1.

@Special-K99 - When I sorted my data, cell with function shows name from row 8, but now correct name is in 10... Can't say, why :/
 
Upvote 0
Assuming the Roles are in column B maybe...

=INDEX(A2:A34;MATCH("D\A";B2:B34;0))

M.
 
Upvote 0
Great! Thank you, Marcelo Branco, your method worked in this case :)

But I think, that your method won't help me, if several people will have the same role? Or will?
 
Upvote 0
Raptoos a Vlookup will not work if you have multiple people in 1 role either, Vlookup finds only the first person with that role.
 
Upvote 0
Great! Thank you, Marcelo Branco, your method worked in this case :)

But I think, that your method won't help me, if several people will have the same role? Or will?

My formula gets just the first instance of "D\A" in column B. If you need multiple results, ie all the names whose role = "D\A", we need a different formula.

Could you please post a data sample?
To do this:
Select a relevant part of your data, say 15 rows including headers.
Put borders
Copy (Ctrl+C)
Paste (Ctrl+V) in the forum reply page

M.
 
Upvote 0
Ok, this is my sheet below. It's for training purposes at the moment - I need to segregate people as the roles are. There is one Query, one FMT, one D/A, some CH and rest should be placed in main table. Also, I want to grab date, when absence end, if someone is on it, but that's different story.
I know, that went away from the thread topic, but I'm trying to get help, as I was able to get it in the first place :)

[TABLE="width: 987"]
<TBODY>[TR]
[TD]Name</SPAN>[/TD]
[TD]Role</SPAN>[/TD]
[TD]Absence till</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2013-05-20</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #1</SPAN>[/TD]
[TD]PO</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD]CH</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD]CH</SPAN>[/TD]
[/TR]
[TR]
[TD]Person #2</SPAN>[/TD]
[TD]TCCom</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD]AS</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD]#N/A</SPAN>[/TD]
[/TR]
[TR]
[TD]Person #3</SPAN>[/TD]
[TD]TCCom</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD]AAL</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Person #4</SPAN>[/TD]
[TD]TCCom</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD]TCCom</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Person #5</SPAN>[/TD]
[TD]AAL</SPAN>[/TD]
[TD="align: right"]2013-05-31</SPAN>[/TD]
[TD][/TD]
[TD]TCCorp</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Person #6</SPAN>[/TD]
[TD]TCCorp</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD]OBT</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Person #7</SPAN>[/TD]
[TD]D\A</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD]PO</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Person #8</SPAN>[/TD]
[TD]PO</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD]FMT</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Person #9</SPAN>[/TD]
[TD]TCCom</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD]Q</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #10</SPAN>[/TD]
[TD]FMT</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD]D\A</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD]Queries</SPAN>[/TD]
[/TR]
[TR]
[TD]Person #11</SPAN>[/TD]
[TD]TCCorp</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD]Person #15</SPAN>[/TD]
[/TR]
[TR]
[TD]Person #12</SPAN>[/TD]
[TD]CH</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #13</SPAN>[/TD]
[TD]CH</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD]FMT:</SPAN>[/TD]
[/TR]
[TR]
[TD]Person #14</SPAN>[/TD]
[TD]TCCorp</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD]Person #10</SPAN>[/TD]
[/TR]
[TR]
[TD]Person #15</SPAN>[/TD]
[TD]Q</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #16</SPAN>[/TD]
[TD]TCCorp</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD]D\A:</SPAN>[/TD]
[/TR]
[TR]
[TD]Person #17</SPAN>[/TD]
[TD]TCCorp</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD]Person #7</SPAN>[/TD]
[/TR]
[TR]
[TD]Person #18</SPAN>[/TD]
[TD]CH</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #19</SPAN>[/TD]
[TD]PO</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #20</SPAN>[/TD]
[TD]PO</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #21</SPAN>[/TD]
[TD]TCCom</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #22</SPAN>[/TD]
[TD]TCCom</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #23</SPAN>[/TD]
[TD]TCCorp</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #24</SPAN>[/TD]
[TD]CH</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #25</SPAN>[/TD]
[TD]CH</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #26</SPAN>[/TD]
[TD]TCCom</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #27</SPAN>[/TD]
[TD]OBT</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #28</SPAN>[/TD]
[TD]CH</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #29</SPAN>[/TD]
[TD]AAL</SPAN>[/TD]
[TD="align: right"]2013-05-21</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #30</SPAN>[/TD]
[TD]AS</SPAN>[/TD]
[TD="align: right"]2013-05-20</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #31</SPAN>[/TD]
[TD]TCCorp</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #32</SPAN>[/TD]
[TD]AAL</SPAN>[/TD]
[TD="align: right"]2013-05-20</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Person #33</SPAN>[/TD]
[TD]OBT</SPAN>[/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</TBODY><COLGROUP><COL><COL><COL><COL span=4><COL><COL span=3><COL></COLGROUP>[/TABLE]
 
Upvote 0
I'm busy now. I'll take a look at later.
In the meantime maybe someone else can help.

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