Formula help needed asap!

meeshes

New Member
Joined
May 24, 2011
Messages
2
:confused:We have 2 sheets, Sheet 1 contains 2 columns, district #s and district names. Sheet 2 only contains district #s.

We want to populate Sheet 2 with the district names that are tied to the district #s in sheet 1. We need this completed ASAP. What is the fastest way to do this without having to manually input all the district names. Please help. Attached is a small sample of the workbook with the two sheets. We need the formula as it needs to be implemented on a sheet with thousands of fields. :warning: HELP!!!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
First make sure your data on Sheet1 is sorted in ascending order by the district number (also, make sure your district numbers are actual numbers, not text). Then in Sheet2 you can use VLOOKUP to get matches:
Excel Workbook
ABCDE
1District#District NameLookup Values:Formulas:
200000District101500District3
300500District2560District2
401200District3
524000District4
630000District5
Sheet

Notice: I've formatted the first lookup District# as text. Therefore I'm using the VALUE-function to make sure the formula returns the right match.
 
Upvote 0
I'm using TRUE as the argument in VLOOKUP (it's also the default argument of the function). It means that if there's no exact match found, the VLOOKUP returns the first smaller match: Think of it as the function was running down the numbers 'till it finds a bigger one - and then takes one step back. The function doesn't look further down the list but turns back after the first value that's bigger than the one it's looking for. Even if there's an exact match somewhere down the list. That's why the list has to be sorted.

If you're sure all your lookup values are identical to the ones in the list, you can change the TRUE to FALSE to make the function look for exact matches only. With FALSE the list doesn't have to be sorted but you will get an error for each lookup value that's not found from the lookup list.
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,558
Members
452,928
Latest member
101blockchains

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