Vlookup question

biglb79

Active Member
Joined
Oct 17, 2007
Messages
294
I'm using expense account names to look up the actual numbers each month, but there are some expense account names that are duplicated in different cost centers. is there a way to have my vlookup choose the 2nd or 3rd value for a name instead of the first one it sees? I wish my report had specific account numbers but it doesn't. below is an example of what I currently have:

Cellular Telephone is the expense account and the formula is =VLOOKUP($B231,'Rolling Trend'!$A:$M,9,0)

in just this example I have Cellular Telephone appearing in row 608 and the next one in 613 but it will vary with each entity so I'm hoping there's a way to have it ignore the first one and grab the 2nd one
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I think it may be helpful for us to see what the data you are trying to pull back looks like. Can you post a small sampling (especially so we can see what is in column 9)? Just be sure to remove any sensitive data first.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

Also, how do you know if you should pull back the 2nd or 3rd match? What is the logic for determing which record to return?
 
Upvote 0
I don't think I can download that feature on my work computer. I'm wondering if these screen shots will work with the data blacked out? but my main issue is I can't describe what the logic is to pulling the 2nd one. I mean technically one falls under corporate fees and one under Utilities, and there would be others further down the report but this is how it exports from Workday to excel


1618495841570.png
 
Upvote 0
but my main issue is I can't describe what the logic is to pulling the 2nd one.
That is a bit problematic.
If you cannot explain the logic in plain English, which one you want return, how can we program anything?
In order to build anything, we need to know what the rules are.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also do you have the cost centre listed anywhere in the row with the formula?
 
Upvote 0

Forum statistics

Threads
1,212,927
Messages
6,110,729
Members
448,294
Latest member
jmjmjmjmjmjm

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