Help with IF function with Matching

Lyryx

New Member
Joined
Aug 18, 2015
Messages
45
I need to make a formula that will check to see if a client's name is part of a range of data and then return the value "Township" if they match. If they don't the value should return a blank. To do this I've used an IF statement and took the cells I was checking against and converted them into a named range.

I've been using the formula =If(D3=TownshipConsumers,"Township","") however this only returns the top value of the named range, rather than checking all of the value's of the named range.

If anyone can tell me what I am doing wrong here that would be greatly appreciated. Thank you.
 

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.
I've also tried =If(Vlookup(D3,TownshipConsumers,1,True),"Township","") but it is returning a #Value! message.


Nevermind I figured it out, My issue came from the Vlookup returning a value of False if the information wasn't included in the range.
So I added an ISERROR to the formula making it look like this.

=IF(ISERROR(VLOOKUP(D3,TownshipConsumers,1,True)),"","Township")
 
Last edited:
Upvote 0
Nevermind... this formula is now populating the list with township no matter what information is entered.
 
Upvote 0
This one works. Sorry for bumping my thread. But to anyone passing by. This is the correct formula.
=IF(ISNA(VLOOKUP(D3,RelatedConsumers,1,FALSE)),"","Related")
 
Upvote 0
This one works. Sorry for bumping my thread. But to anyone passing by. This is the correct formula.
=IF(ISNA(VLOOKUP(D3,RelatedConsumers,1,FALSE)),"","Related")

I am trying to do something similar.

I need to insert the appropriate name to the assigned # from one spreadsheet to the next. I'll see if this will work for me. thanks.
 
Upvote 0

Forum statistics

Threads
1,215,744
Messages
6,126,629
Members
449,323
Latest member
Smarti1

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