Help with formula...

veespike

New Member
Joined
May 11, 2006
Messages
16
I am using a formula to lookup address information and paste it into a sheet, and need help fixing an error.

This is the formula:

Code:
=IF($H$20=0,"",VLOOKUP($H$20,'Nashville Lookup Tables.xls'!NashvilleCust,6,TRUE)&", "& VLOOKUP($H$20,'Nashville Lookup Tables.xls'!NashvilleCust,7,TRUE)&"  "& VLOOKUP($H$20,'Nashville Lookup Tables.xls'!NashvilleCust,8,FALSE))

This formula throws a #VALUE error on the last statement. The referenced column in the table has zip codes in it.

I tried converting it with a TEXT statement, but either I was entering it wrong, or that is the wrong method.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Andrew

I use a 0 instead of TRUE and FALSE. What's the difference between using a 0 or TRUE and FALSE for the lookups?
 
Upvote 0
Try changing the FALSE to TRUE, like in the other VLOOKUPs. FALSE expects an exact match.

I tried this, and it did not work. It still reports a #VALUE error.

I actually got it to return a value and not an error with this:
Code:
=IF($H$20=0,"",VLOOKUP($H$20,'C:\Nashville Lookup Tables.xls'!NashvilleCust,6,true)&", "& VLOOKUP($H$20,'C:\Nashville Lookup Tables.xls'!NashvilleCust,7,true)&"  "& (TEXT(VLOOKUP($H$20,'C:\Nashville Lookup Tables.xls'!NashvilleCust,8,true),"Zip Code")))

But the formula returns something totally odd this way. The value in place s/b "Saint Charles, MO 63303" What I get back is "Saint Charles, MO Zip Co242073"

I also tried changing the data in the table from numerical to text format, and that did not work. Everything I have read tells me that the problem is trying to concatenate text and numerical data at the same time.
 
Upvote 0
There is no problem concatenating text and numbers, eg:

="Saint Charles, MO "&63303

But the format for Zip Code isn't "Zip Code" but "00000". The formula:

=TEXT(63303,"Zip Code")

returns #VALUE!, but:

=TEXT(63303,"00000")

returns 63303.
 
Upvote 0
There is no problem concatenating text and numbers, eg:

="Saint Charles, MO "&63303

But the format for Zip Code isn't "Zip Code" but "00000". The formula:

=TEXT(63303,"Zip Code")

returns #VALUE!, but:

=TEXT(63303,"00000")

returns 63303.

Ah! That works. Thank you.
 
Upvote 0

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

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