A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

If and LOOKUP - results in multiple columns



 
 
Thread Tools Display Modes
  #1  
Old March 16th, 2010, 08:15 PM posted to microsoft.public.excel.worksheet.functions
Joodle
external usenet poster
 
Posts: 3
Default If and LOOKUP - results in multiple columns

I want to lookup a value in a table, then return a value to a different
column based on the result.

For example:

Sheet 1 has:

col A
------
1
2
3
4

Sheet 2 (LOOKUP table) has:

col A col B
------ ------
1 Apple
2 Banana
3 Carrot
4 Date

I want to write a formula in sheet 1 that says:

if the value in col A is 1, enter Apple in col B
if the value in col A is 2, enter Banana in col C
if the value in col A is 3, enter Carrot in col D
if the value in col A is 4, enter Date in col E
  #2  
Old March 16th, 2010, 08:44 PM posted to microsoft.public.excel.worksheet.functions
Eva
external usenet poster
 
Posts: 316
Default If and LOOKUP - results in multiple columns

Hi
The formula
=VLOOKUP(A1,Sheet2!A:B,2,FALSE)
--
Please click "yes" if this post helped you!

Greatly appreciated

Eva


"Joodle" wrote:

I want to lookup a value in a table, then return a value to a different
column based on the result.

For example:

Sheet 1 has:

col A
------
1
2
3
4

Sheet 2 (LOOKUP table) has:

col A col B
------ ------
1 Apple
2 Banana
3 Carrot
4 Date

I want to write a formula in sheet 1 that says:

if the value in col A is 1, enter Apple in col B
if the value in col A is 2, enter Banana in col C
if the value in col A is 3, enter Carrot in col D
if the value in col A is 4, enter Date in col E

  #3  
Old March 16th, 2010, 11:02 PM posted to microsoft.public.excel.worksheet.functions
Joodle
external usenet poster
 
Posts: 3
Default If and LOOKUP - results in multiple columns

This formula placed all the results from the lookup in the same column.

I want the results such that all "Apple" are in col B, all "Banana" are in
col C, all "Carrot" are in col D, and all "Date" are in col E.

"Eva" wrote:

Hi
The formula
=VLOOKUP(A1,Sheet2!A:B,2,FALSE)
--
Please click "yes" if this post helped you!

Greatly appreciated

Eva


"Joodle" wrote:

I want to lookup a value in a table, then return a value to a different
column based on the result.

For example:

Sheet 1 has:

col A
------
1
2
3
4

Sheet 2 (LOOKUP table) has:

col A col B
------ ------
1 Apple
2 Banana
3 Carrot
4 Date

I want to write a formula in sheet 1 that says:


  #4  
Old March 16th, 2010, 11:21 PM posted to microsoft.public.excel.worksheet.functions
Eva
external usenet poster
 
Posts: 316
Default If and LOOKUP - results in multiple columns

Hi
I don't know what you want to accomplish, but try this
=TRANSPOSE(VLOOKUP($A2,Sheet2!$A:$B,2,FALSE))
(it is array formula ctrl+shift+enter)
--
Please click "yes" if this post helped you!

Greatly appreciated

Eva


"Joodle" wrote:

This formula placed all the results from the lookup in the same column.

I want the results such that all "Apple" are in col B, all "Banana" are in
col C, all "Carrot" are in col D, and all "Date" are in col E.

"Eva" wrote:

Hi
The formula
=VLOOKUP(A1,Sheet2!A:B,2,FALSE)
--
Please click "yes" if this post helped you!

Greatly appreciated

Eva


"Joodle" wrote:

I want to lookup a value in a table, then return a value to a different
column based on the result.

For example:

Sheet 1 has:

col A
------
1
2
3
4

Sheet 2 (LOOKUP table) has:

col A col B
------ ------
1 Apple
2 Banana
3 Carrot
4 Date

I want to write a formula in sheet 1 that says:


  #5  
Old March 17th, 2010, 01:20 AM posted to microsoft.public.excel.worksheet.functions
Teethless mama
external usenet poster
 
Posts: 3,722
Default If and LOOKUP - results in multiple columns

In B1: =IF(A1=1,"Apple","")
In C1: =IF(A1=2,"Banana","")
and so on...


"Joodle" wrote:

I want to lookup a value in a table, then return a value to a different
column based on the result.

For example:

Sheet 1 has:

col A
------
1
2
3
4

Sheet 2 (LOOKUP table) has:

col A col B
------ ------
1 Apple
2 Banana
3 Carrot
4 Date

I want to write a formula in sheet 1 that says:

if the value in col A is 1, enter Apple in col B
if the value in col A is 2, enter Banana in col C
if the value in col A is 3, enter Carrot in col D
if the value in col A is 4, enter Date in col E

  #6  
Old March 17th, 2010, 02:03 AM posted to microsoft.public.excel.worksheet.functions
Joodle
external usenet poster
 
Posts: 3
Default If and LOOKUP - results in multiple columns

That's it! Thanks. I was trying to make it so much more complicated!

"Teethless mama" wrote:

In B1: =IF(A1=1,"Apple","")
In C1: =IF(A1=2,"Banana","")
and so on...


"Joodle" wrote:

I want to lookup a value in a table, then return a value to a different
column based on the result.

For example:

Sheet 1 has:

col A
------
1
2
3
4

Sheet 2 (LOOKUP table) has:

col A col B
------ ------
1 Apple
2 Banana
3 Carrot
4 Date

I want to write a formula in sheet 1 that says:

if the value in col A is 1, enter Apple in col B
if the value in col A is 2, enter Banana in col C
if the value in col A is 3, enter Carrot in col D
if the value in col A is 4, enter Date in col E

  #7  
Old March 17th, 2010, 02:26 AM posted to microsoft.public.excel.worksheet.functions
Teethless mama
external usenet poster
 
Posts: 3,722
Default If and LOOKUP - results in multiple columns

You're Welcome!


"Joodle" wrote:

That's it! Thanks. I was trying to make it so much more complicated!

"Teethless mama" wrote:

In B1: =IF(A1=1,"Apple","")
In C1: =IF(A1=2,"Banana","")
and so on...


"Joodle" wrote:

I want to lookup a value in a table, then return a value to a different
column based on the result.

For example:

Sheet 1 has:

col A
------
1
2
3
4

Sheet 2 (LOOKUP table) has:

col A col B
------ ------
1 Apple
2 Banana
3 Carrot
4 Date

I want to write a formula in sheet 1 that says:

if the value in col A is 1, enter Apple in col B
if the value in col A is 2, enter Banana in col C
if the value in col A is 3, enter Carrot in col D
if the value in col A is 4, enter Date in col E

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:34 AM.


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