Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jh3016
 
Posts: n/a
Default Value if criteria met

I have a simple question, I believe.

I would like if H2 contains "Grapes", then enter "Grapes" in J2. If H2
contains "Oranges", then enter "Oranges in J2. If H2 does not contain Grapes
or Oranges, enter "Neither" in J2.

Can someone give me the formula for this?

Thanks in advance.
  #2   Report Post  
StinkeyPete
 
Posts: n/a
Default

=IF(H2="Grapes","Grapes",IF(H2="Oranges","Oranges" ,"Neither"))

"jh3016" wrote:

I have a simple question, I believe.

I would like if H2 contains "Grapes", then enter "Grapes" in J2. If H2
contains "Oranges", then enter "Oranges in J2. If H2 does not contain Grapes
or Oranges, enter "Neither" in J2.

Can someone give me the formula for this?

Thanks in advance.

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

=IF(AND(H2<"Graapes",H2<"Oranges"),"Neither",H2)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"jh3016" wrote in message
...
I have a simple question, I believe.

I would like if H2 contains "Grapes", then enter "Grapes" in J2. If H2
contains "Oranges", then enter "Oranges in J2. If H2 does not contain

Grapes
or Oranges, enter "Neither" in J2.

Can someone give me the formula for this?

Thanks in advance.



  #4   Report Post  
Domenic
 
Posts: n/a
Default

Try...

=IF(H2="Grapes","Grapes",IF(H2="Oranges","Orange", "Neither"))

Hope this helps!

In article ,
jh3016 wrote:

I have a simple question, I believe.

I would like if H2 contains "Grapes", then enter "Grapes" in J2. If H2
contains "Oranges", then enter "Oranges in J2. If H2 does not contain Grapes
or Oranges, enter "Neither" in J2.

Can someone give me the formula for this?

Thanks in advance.

  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

Would help if I could spell

=IF(AND(H2<"Grapes",H2<"Oranges"),"Neither",H2)


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bob Phillips" wrote in message
...
=IF(AND(H2<"Graapes",H2<"Oranges"),"Neither",H2)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"jh3016" wrote in message
...
I have a simple question, I believe.

I would like if H2 contains "Grapes", then enter "Grapes" in J2. If H2
contains "Oranges", then enter "Oranges in J2. If H2 does not contain

Grapes
or Oranges, enter "Neither" in J2.

Can someone give me the formula for this?

Thanks in advance.







  #6   Report Post  
jh3016
 
Posts: n/a
Default

The formula works if H2 has "Grapes" or "Oranges" exactly. What I need is if
it CONTAINS "Grapes" or "Oranges".

Thanks again.

"Domenic" wrote:

Try...

=IF(H2="Grapes","Grapes",IF(H2="Oranges","Orange", "Neither"))

Hope this helps!

In article ,
jh3016 wrote:

I have a simple question, I believe.

I would like if H2 contains "Grapes", then enter "Grapes" in J2. If H2
contains "Oranges", then enter "Oranges in J2. If H2 does not contain Grapes
or Oranges, enter "Neither" in J2.

Can someone give me the formula for this?

Thanks in advance.


  #7   Report Post  
Domenic
 
Posts: n/a
Default

Try the following instead...

=IF(OR(ISNUMBER(SEARCH({"Grapes","Oranges"},H2))), H2,"Neither")

Hope this helps!

In article ,
jh3016 wrote:

The formula works if H2 has "Grapes" or "Oranges" exactly. What I need is if
it CONTAINS "Grapes" or "Oranges".

Thanks again.

"Domenic" wrote:

Try...

=IF(H2="Grapes","Grapes",IF(H2="Oranges","Orange", "Neither"))

Hope this helps!

In article ,
jh3016 wrote:

I have a simple question, I believe.

I would like if H2 contains "Grapes", then enter "Grapes" in J2. If H2
contains "Oranges", then enter "Oranges in J2. If H2 does not contain
Grapes
or Oranges, enter "Neither" in J2.

Can someone give me the formula for this?

Thanks in advance.


  #8   Report Post  
Domenic
 
Posts: n/a
Default

Sorry, make that...

=IF(ISNUMBER(SEARCH("Grapes",H2)),"Grapes",IF(ISNU MBER(SEARCH("Oranges",H
2)),"Oranges","Neither"))

Hope this helps!

In article ,
Domenic wrote:

Try the following instead...

=IF(OR(ISNUMBER(SEARCH({"Grapes","Oranges"},H2))), H2,"Neither")

Hope this helps!

  #9   Report Post  
jh3016
 
Posts: n/a
Default

I get an error when I run this.

"Domenic" wrote:

Sorry, make that...

=IF(ISNUMBER(SEARCH("Grapes",H2)),"Grapes",IF(ISNU MBER(SEARCH("Oranges",H
2)),"Oranges","Neither"))

Hope this helps!

In article ,
Domenic wrote:

Try the following instead...

=IF(OR(ISNUMBER(SEARCH({"Grapes","Oranges"},H2))), H2,"Neither")

Hope this helps!


  #10   Report Post  
Domenic
 
Posts: n/a
Default

If you copied and pasted the formula into your spreadsheet, make sure a
line break hasn't been added.

Does this help?

In article ,
jh3016 wrote:

I get an error when I run this.

"Domenic" wrote:

Sorry, make that...

=IF(ISNUMBER(SEARCH("Grapes",H2)),"Grapes",IF(ISNU MBER(SEARCH("Oranges",H
2)),"Oranges","Neither"))

Hope this helps!

In article ,
Domenic wrote:

Try the following instead...

=IF(OR(ISNUMBER(SEARCH({"Grapes","Oranges"},H2))), H2,"Neither")

Hope this helps!


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
Find largest alphanumeric value matching alpha criteria in databas Alison Excel Worksheet Functions 7 August 4th 05 06:59 PM
sorting more than 3 keys Brooke Excel Discussion (Misc queries) 3 June 18th 05 04:52 AM
Countif using format criteria....not number criteria? Troy Excel Worksheet Functions 1 April 20th 05 04:50 AM
Can I get the mode, min, and max with multiple criteria? BobT Excel Discussion (Misc queries) 1 February 15th 05 03:20 AM
SUMPRODUCT Formula to Count Row of data Below Matched Criteria Sam via OfficeKB.com Excel Worksheet Functions 8 February 3rd 05 01:37 AM


All times are GMT +1. The time now is 12:26 AM.

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"