#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default lookup

I think this has an easy fix, but I can't seem to get my head around it right
now.

I have a column of data which has a variety of formulas in it that return a
variety of words. I would like a way to know if two certain words are in that
column. If they are, I want to know which word is present. Here is an example

Bob
Mike
Tom
Alan

I want to know if it says "John" or if it says "Tom" and it to return which
name so my final result here would be "Tom". My data will never have both a
John and a Tom in the same column, but Tom or John could be in row 3 or 4 or
5, etc.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default lookup

I think this'll work

=IF(COUNTA(G1:G4)=COUNTA(SUBSTITUTE(G1:G4,"Bob","" )),"john","bob")

"jenhow" wrote:

I think this has an easy fix, but I can't seem to get my head around it right
now.

I have a column of data which has a variety of formulas in it that return a
variety of words. I would like a way to know if two certain words are in that
column. If they are, I want to know which word is present. Here is an example

Bob
Mike
Tom
Alan

I want to know if it says "John" or if it says "Tom" and it to return which
name so my final result here would be "Tom". My data will never have both a
John and a Tom in the same column, but Tom or John could be in row 3 or 4 or
5, etc.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default lookup

No - that doesn't work - should have tested it first

Try

=IF(SUMPRODUCT(--(G1:G4="Bob"))0,"Bob","John")

"jenhow" wrote:

I think this has an easy fix, but I can't seem to get my head around it right
now.

I have a column of data which has a variety of formulas in it that return a
variety of words. I would like a way to know if two certain words are in that
column. If they are, I want to know which word is present. Here is an example

Bob
Mike
Tom
Alan

I want to know if it says "John" or if it says "Tom" and it to return which
name so my final result here would be "Tom". My data will never have both a
John and a Tom in the same column, but Tom or John could be in row 3 or 4 or
5, etc.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default lookup

=IF(ISERROR(VLOOKUP("Tom",A1:A20,1,0)),"John","Tom ")
or
=IF(COUNTIF(A1:A20,"John"),"John","Tom")
or
=IF(A1:A20="John","John","Tom")


"jenhow" wrote:

I think this has an easy fix, but I can't seem to get my head around it right
now.

I have a column of data which has a variety of formulas in it that return a
variety of words. I would like a way to know if two certain words are in that
column. If they are, I want to know which word is present. Here is an example

Bob
Mike
Tom
Alan

I want to know if it says "John" or if it says "Tom" and it to return which
name so my final result here would be "Tom". My data will never have both a
John and a Tom in the same column, but Tom or John could be in row 3 or 4 or
5, etc.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default lookup

=IF(A1:A20="John","John","Tom")

Do you test the formulas that you post?

Biff

"Teethless mama" wrote in message
...
=IF(ISERROR(VLOOKUP("Tom",A1:A20,1,0)),"John","Tom ")
or
=IF(COUNTIF(A1:A20,"John"),"John","Tom")
or
=IF(A1:A20="John","John","Tom")


"jenhow" wrote:

I think this has an easy fix, but I can't seem to get my head around it
right
now.

I have a column of data which has a variety of formulas in it that return
a
variety of words. I would like a way to know if two certain words are in
that
column. If they are, I want to know which word is present. Here is an
example

Bob
Mike
Tom
Alan

I want to know if it says "John" or if it says "Tom" and it to return
which
name so my final result here would be "Tom". My data will never have
both a
John and a Tom in the same column, but Tom or John could be in row 3 or 4
or
5, etc.






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default lookup

Harlan?

Is that you????

<gd&r

"T. Valko" wrote:

=IF(A1:A20="John","John","Tom")


Do you test the formulas that you post?

Biff

"Teethless mama" wrote in message
...
=IF(ISERROR(VLOOKUP("Tom",A1:A20,1,0)),"John","Tom ")
or
=IF(COUNTIF(A1:A20,"John"),"John","Tom")
or
=IF(A1:A20="John","John","Tom")


"jenhow" wrote:

I think this has an easy fix, but I can't seem to get my head around it
right
now.

I have a column of data which has a variety of formulas in it that return
a
variety of words. I would like a way to know if two certain words are in
that
column. If they are, I want to know which word is present. Here is an
example

Bob
Mike
Tom
Alan

I want to know if it says "John" or if it says "Tom" and it to return
which
name so my final result here would be "Tom". My data will never have
both a
John and a Tom in the same column, but Tom or John could be in row 3 or 4
or
5, etc.



--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default lookup

<gd&r

I had to Google that one!

Biff

"Dave Peterson" wrote in message
...
Harlan?

Is that you????

<gd&r

"T. Valko" wrote:

=IF(A1:A20="John","John","Tom")


Do you test the formulas that you post?

Biff

"Teethless mama" wrote in
message
...
=IF(ISERROR(VLOOKUP("Tom",A1:A20,1,0)),"John","Tom ")
or
=IF(COUNTIF(A1:A20,"John"),"John","Tom")
or
=IF(A1:A20="John","John","Tom")


"jenhow" wrote:

I think this has an easy fix, but I can't seem to get my head around
it
right
now.

I have a column of data which has a variety of formulas in it that
return
a
variety of words. I would like a way to know if two certain words are
in
that
column. If they are, I want to know which word is present. Here is an
example

Bob
Mike
Tom
Alan

I want to know if it says "John" or if it says "Tom" and it to return
which
name so my final result here would be "Tom". My data will never have
both a
John and a Tom in the same column, but Tom or John could be in row 3
or 4
or
5, etc.



--

Dave Peterson



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default lookup

That works great once the data is filled in, but can I make it so that if no
data is filled it, it won't give me "John" as an answer? So I would like
nothing returned if neither john or bob is present, then once the column has
data it will find john or bob. Does that make sense? Thanks for you help.

"Duke Carey" wrote:

No - that doesn't work - should have tested it first

Try

=IF(SUMPRODUCT(--(G1:G4="Bob"))0,"Bob","John")

"jenhow" wrote:

I think this has an easy fix, but I can't seem to get my head around it right
now.

I have a column of data which has a variety of formulas in it that return a
variety of words. I would like a way to know if two certain words are in that
column. If they are, I want to know which word is present. Here is an example

Bob
Mike
Tom
Alan

I want to know if it says "John" or if it says "Tom" and it to return which
name so my final result here would be "Tom". My data will never have both a
John and a Tom in the same column, but Tom or John could be in row 3 or 4 or
5, etc.


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
Join 2 Lists - Lookup value in 1 list & use result in 2nd lookup JBush Excel Worksheet Functions 3 January 3rd 07 11:14 PM
Sumproduct - Condition based on lookup of a Lookup Hari Excel Discussion (Misc queries) 12 May 31st 06 09:28 AM
Advanced Lookup (lookup for 2 values) 0-0 Wai Wai ^-^ Excel Worksheet Functions 2 March 30th 06 07:09 PM
Pivot table doing a lookup without using the lookup function? NGASGELI Excel Discussion (Misc queries) 0 August 2nd 05 05:08 AM
How do I lookup and return different values when the lookup value. kg Excel Discussion (Misc queries) 1 January 20th 05 12:53 AM


All times are GMT +1. The time now is 09:18 AM.

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

About Us

"It's about Microsoft Excel"