Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Array or Vlookup

Hi,

Do I need a standard formula or an array to solve the following problem?

I have several vlookup formula each in a separate row that look up a site
code and returns parts of an address eg.

=vlookup(sitecode,addressrange, 2) returns add1
=vlookup(sitecode,addressrange, 3) returns add2
=vlookup(sitecode,addressrange, 4) returns add3
=vlookup(sitecode,addressrange, 5) returns add4
=vlookup(sitecode,addressrange, 6) returns zip

This works fine when the address has 5 elements but where there's only 2
elements of an address plus zip code the retuned address looks like the
following

add1
add2
[blank row]
[blank row]
zip code

What formula can I use to get the address to display correctly i.e.

add1
add2
zip code
[blank row]
[blank row]

Hopefully I have explained myself!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Array or Vlookup

Robert,

Kludgy but

=IF(vlookup(sitecode,addressrange, 4)<"",vlookup(sitecode,addressrange,
4),IF(vlookup(sitecode,addressrange, 5)<"",vlookup(sitecode,addressrange,
5),vlookup(sitecode,addressrange, 6)))

then next row

=IF(vlookup(sitecode,addressrange, 5)<"",vlookup(sitecode,addressrange,
5),vlookup(sitecode,addressrange, 6))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert" wrote in message
...
Hi,

Do I need a standard formula or an array to solve the following problem?

I have several vlookup formula each in a separate row that look up a site
code and returns parts of an address eg.

=vlookup(sitecode,addressrange, 2) returns add1
=vlookup(sitecode,addressrange, 3) returns add2
=vlookup(sitecode,addressrange, 4) returns add3
=vlookup(sitecode,addressrange, 5) returns add4
=vlookup(sitecode,addressrange, 6) returns zip

This works fine when the address has 5 elements but where there's only 2
elements of an address plus zip code the retuned address looks like the
following

add1
add2
[blank row]
[blank row]
zip code

What formula can I use to get the address to display correctly i.e.

add1
add2
zip code
[blank row]
[blank row]

Hopefully I have explained myself!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Array or Vlookup

Bob,

Have done as suggested but the issue is that the last row repeats the zip
code as there is always an entry in this offset position and the previous
formula also checks and enters where it hasn't another address entry.

I'm sure and array formula would do what I need, I just cant figure it out.

Thanks, Robert


"Bob Phillips" wrote in message
...
Robert,

Kludgy but

=IF(vlookup(sitecode,addressrange, 4)<"",vlookup(sitecode,addressrange,
4),IF(vlookup(sitecode,addressrange, 5)<"",vlookup(sitecode,addressrange,
5),vlookup(sitecode,addressrange, 6)))

then next row

=IF(vlookup(sitecode,addressrange, 5)<"",vlookup(sitecode,addressrange,
5),vlookup(sitecode,addressrange, 6))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert" wrote in message
...
Hi,

Do I need a standard formula or an array to solve the following problem?

I have several vlookup formula each in a separate row that look up a

site
code and returns parts of an address eg.

=vlookup(sitecode,addressrange, 2) returns add1
=vlookup(sitecode,addressrange, 3) returns add2
=vlookup(sitecode,addressrange, 4) returns add3
=vlookup(sitecode,addressrange, 5) returns add4
=vlookup(sitecode,addressrange, 6) returns zip

This works fine when the address has 5 elements but where there's only 2
elements of an address plus zip code the retuned address looks like the
following

add1
add2
[blank row]
[blank row]
zip code

What formula can I use to get the address to display correctly i.e.

add1
add2
zip code
[blank row]
[blank row]

Hopefully I have explained myself!






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Array or Vlookup

Robert,

I didn't include a zip code formula, but this should do it.

=IF(OR(vlookup(sitecode,addressrange, 4)="",vlookup(sitecode,addressrange,
5)=""),"",vlookup(sitecode,addressrange, 6)


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert" wrote in message
...
Bob,

Have done as suggested but the issue is that the last row repeats the zip
code as there is always an entry in this offset position and the previous
formula also checks and enters where it hasn't another address entry.

I'm sure and array formula would do what I need, I just cant figure it

out.

Thanks, Robert


"Bob Phillips" wrote in message
...
Robert,

Kludgy but

=IF(vlookup(sitecode,addressrange, 4)<"",vlookup(sitecode,addressrange,
4),IF(vlookup(sitecode,addressrange,

5)<"",vlookup(sitecode,addressrange,
5),vlookup(sitecode,addressrange, 6)))

then next row

=IF(vlookup(sitecode,addressrange, 5)<"",vlookup(sitecode,addressrange,
5),vlookup(sitecode,addressrange, 6))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert" wrote in message
...
Hi,

Do I need a standard formula or an array to solve the following

problem?

I have several vlookup formula each in a separate row that look up a

site
code and returns parts of an address eg.

=vlookup(sitecode,addressrange, 2) returns add1
=vlookup(sitecode,addressrange, 3) returns add2
=vlookup(sitecode,addressrange, 4) returns add3
=vlookup(sitecode,addressrange, 5) returns add4
=vlookup(sitecode,addressrange, 6) returns zip

This works fine when the address has 5 elements but where there's only

2
elements of an address plus zip code the retuned address looks like

the
following

add1
add2
[blank row]
[blank row]
zip code

What formula can I use to get the address to display correctly i.e.

add1
add2
zip code
[blank row]
[blank row]

Hopefully I have explained myself!








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Array or Vlookup

Bob,

Sorry but I'm not getting this to work, entering the formula simply puts the
zip code in twice, whereas I'm looking for it to only appear once.

I shall keep trying!

Thanks, Robert

"Bob Phillips" wrote in message
...
Robert,

I didn't include a zip code formula, but this should do it.

=IF(OR(vlookup(sitecode,addressrange, 4)="",vlookup(sitecode,addressrange,
5)=""),"",vlookup(sitecode,addressrange, 6)


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert" wrote in message
...
Bob,

Have done as suggested but the issue is that the last row repeats the

zip
code as there is always an entry in this offset position and the

previous
formula also checks and enters where it hasn't another address entry.

I'm sure and array formula would do what I need, I just cant figure it

out.

Thanks, Robert


"Bob Phillips" wrote in message
...
Robert,

Kludgy but

=IF(vlookup(sitecode,addressrange,

4)<"",vlookup(sitecode,addressrange,
4),IF(vlookup(sitecode,addressrange,

5)<"",vlookup(sitecode,addressrange,
5),vlookup(sitecode,addressrange, 6)))

then next row

=IF(vlookup(sitecode,addressrange,

5)<"",vlookup(sitecode,addressrange,
5),vlookup(sitecode,addressrange, 6))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert" wrote in message
...
Hi,

Do I need a standard formula or an array to solve the following

problem?

I have several vlookup formula each in a separate row that look up a

site
code and returns parts of an address eg.

=vlookup(sitecode,addressrange, 2) returns add1
=vlookup(sitecode,addressrange, 3) returns add2
=vlookup(sitecode,addressrange, 4) returns add3
=vlookup(sitecode,addressrange, 5) returns add4
=vlookup(sitecode,addressrange, 6) returns zip

This works fine when the address has 5 elements but where there's

only
2
elements of an address plus zip code the retuned address looks like

the
following

add1
add2
[blank row]
[blank row]
zip code

What formula can I use to get the address to display correctly i.e.

add1
add2
zip code
[blank row]
[blank row]

Hopefully I have explained myself!












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Array or Vlookup

Robert,

Do you want to email the workbook (bob . phillips @ tiscali . co . uk -
remove the spaces) and I will take a look?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert" wrote in message
...
Bob,

Sorry but I'm not getting this to work, entering the formula simply puts

the
zip code in twice, whereas I'm looking for it to only appear once.

I shall keep trying!

Thanks, Robert

"Bob Phillips" wrote in message
...
Robert,

I didn't include a zip code formula, but this should do it.

=IF(OR(vlookup(sitecode,addressrange,

4)="",vlookup(sitecode,addressrange,
5)=""),"",vlookup(sitecode,addressrange, 6)


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert" wrote in message
...
Bob,

Have done as suggested but the issue is that the last row repeats the

zip
code as there is always an entry in this offset position and the

previous
formula also checks and enters where it hasn't another address entry.

I'm sure and array formula would do what I need, I just cant figure it

out.

Thanks, Robert


"Bob Phillips" wrote in message
...
Robert,

Kludgy but

=IF(vlookup(sitecode,addressrange,

4)<"",vlookup(sitecode,addressrange,
4),IF(vlookup(sitecode,addressrange,

5)<"",vlookup(sitecode,addressrange,
5),vlookup(sitecode,addressrange, 6)))

then next row

=IF(vlookup(sitecode,addressrange,

5)<"",vlookup(sitecode,addressrange,
5),vlookup(sitecode,addressrange, 6))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert" wrote in message
...
Hi,

Do I need a standard formula or an array to solve the following

problem?

I have several vlookup formula each in a separate row that look up

a
site
code and returns parts of an address eg.

=vlookup(sitecode,addressrange, 2) returns add1
=vlookup(sitecode,addressrange, 3) returns add2
=vlookup(sitecode,addressrange, 4) returns add3
=vlookup(sitecode,addressrange, 5) returns add4
=vlookup(sitecode,addressrange, 6) returns zip

This works fine when the address has 5 elements but where there's

only
2
elements of an address plus zip code the retuned address looks

like
the
following

add1
add2
[blank row]
[blank row]
zip code

What formula can I use to get the address to display correctly

i.e.

add1
add2
zip code
[blank row]
[blank row]

Hopefully I have explained myself!












Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP or Array or neither Rob Excel Discussion (Misc queries) 4 May 26th 09 03:06 PM
VLOOKUP & Array AlanR Excel Worksheet Functions 8 April 1st 09 02:48 AM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
vlookup with a sum of array Jerry (the latin men) Excel Worksheet Functions 5 January 17th 07 02:31 AM
VLOOKUP ARRAY Dave Excel Discussion (Misc queries) 2 November 21st 06 04:08 PM


All times are GMT +1. The time now is 04:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"