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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Try changing the FALSE to TRUE, like in the other VLOOKUPs. FALSE expects an exact match.
 

davidhall80

Well-known Member
Joined
Jul 8, 2006
Messages
663
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?
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
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?

In Excel FALSE evaluates to 0, and TRUE to 1.
 

veespike

New Member
Joined
May 11, 2006
Messages
16

ADVERTISEMENT

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.
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
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.
 

veespike

New Member
Joined
May 11, 2006
Messages
16
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.
 

Forum statistics

Threads
1,136,369
Messages
5,675,360
Members
419,565
Latest member
Phil57

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
Top