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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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 :)

Name</SPAN>Role</SPAN>Absence till</SPAN>2013-05-20</SPAN>
Person #1</SPAN>PO</SPAN> CH</SPAN> CH</SPAN>
Person #2</SPAN>TCCom</SPAN> AS</SPAN> #N/A</SPAN>
Person #3</SPAN>TCCom</SPAN> AAL</SPAN>
Person #4</SPAN>TCCom</SPAN> TCCom</SPAN>
Person #5</SPAN>AAL</SPAN>2013-05-31</SPAN>TCCorp</SPAN>
Person #6</SPAN>TCCorp</SPAN> OBT</SPAN>
Person #7</SPAN>D\A</SPAN> PO</SPAN>
Person #8</SPAN>PO</SPAN> FMT</SPAN>
Person #9</SPAN>TCCom</SPAN> Q</SPAN>
Person #10</SPAN>FMT</SPAN> D\A</SPAN> Queries</SPAN>
Person #11</SPAN>TCCorp</SPAN> Person #15</SPAN>
Person #12</SPAN>CH</SPAN>
Person #13</SPAN>CH</SPAN> FMT:</SPAN>
Person #14</SPAN>TCCorp</SPAN> Person #10</SPAN>
Person #15</SPAN>Q</SPAN>
Person #16</SPAN>TCCorp</SPAN> D\A:</SPAN>
Person #17</SPAN>TCCorp</SPAN> Person #7</SPAN>
Person #18</SPAN>CH</SPAN>
Person #19</SPAN>PO</SPAN>
Person #20</SPAN>PO</SPAN>
Person #21</SPAN>TCCom</SPAN>
Person #22</SPAN>TCCom</SPAN>
Person #23</SPAN>TCCorp</SPAN>
Person #24</SPAN>CH</SPAN>
Person #25</SPAN>CH</SPAN>
Person #26</SPAN>TCCom</SPAN>
Person #27</SPAN>OBT</SPAN>
Person #28</SPAN>CH</SPAN>
Person #29</SPAN>AAL</SPAN>2013-05-21</SPAN>
Person #30</SPAN>AS</SPAN>2013-05-20</SPAN>
Person #31</SPAN>TCCorp</SPAN>
Person #32</SPAN>AAL</SPAN>2013-05-20</SPAN>
Person #33</SPAN>OBT</SPAN>

<TBODY>
</TBODY><COLGROUP><COL><COL><COL><COL span=4><COL><COL span=3><COL></COLGROUP>
 
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,216,460
Messages
6,130,771
Members
449,589
Latest member
Hana2911

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