View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default Formula help needed

=IF(OR(ISNUMBER(SEARCH("IN",$G2)),ISNUMBER(SEARCH( "ENT",$G2))),$L2,"")
--
David Biddulph

"Jeremy" wrote in message
...
=IF(ISNUMBER(SEARCH("IN",$G2)),$L2,"") is the formula that I am using.
What
I am trying to do is where the "IN" is have it where it can be "IN" or
"ENT".

Thank you

"JoeU2004" wrote:

"Jeremy" wrote:
Thank you for your help I believe this is what I am going to use. One
more
thing on the formula. What if I have two variables for C1 where I want
to
be
EX and EXT?


Glad it helped. It is difficult to address your follow-up question
because
I am not sure which set of formulas you opted for, and "have two
variables"
is a little vague.

Perhaps the following paradigm will help:

=if(and(D1=E1,isnumber(search("EX",A1))), B1, "")

If that does not answer your question (I can understand why it wouldn't),
post a specific example, as you did before, showing how you would use the
two conditions to make a decision.


----- original message -----

"Jeremy" wrote in message
...
Joe,

Thank you for your help I believe this is what I am going to use. One
more
thing on the formula. What if I have two variables for C1 where I want
to
be
EX and EXT?

Thanks

"JoeU2004" wrote:

Ostensibly, put the following into C1 and D1, then copy down:

C1: =if(isnumber(search("EX",A1)), B1, "")

D1: =if(isnumber(search("ENT",A1)),B1,"")

Caveats:

1. SEARCH is case-insensitive; for example, it will match "ex" as well
as
"EX". If you prefer not to match lowercase, use FIND instead of
SEARCH.

2. This will match "EX" or "ENT" contained anywhere, an apparent
requirement
given your examples. But consider the following ambiguity in A1: ENT
EX51B1A1. The formulas above will yield the same value in both C1 and
D1.

There is no solution for #2 unless you qualify the syntactic
requirements.
For example, if EX or ENT can only appear in the left or right of the
text,
and they will never appear in both left and right, then the following
might
suffice:

C1: =if(or(left(A1,2)="ex", right(A1,2)="ex"), B1, "")

D1: =if(or(left(A1,3)="ent", right(A1,3)="ent"), B1, "")

Again, those formulas are case-insensitive.


----- original message -----

"Jeremy" wrote in message
...
I am looking for a formula to place what is in B in either C or D
based
off
of if A has an EX or ENT in it. EX goes in C where ENT goes in D.
Below
the
first example is what I have and the second is what I would like.

Thank you



A B C D
1 CGVEHEX 1500
2 ENTB2A0 2500
3 EX NM51B1A1 2600
4 ENT W NM 2780

Example 2
A B C D
1 CGVEHEX 1500 1500
2 ENTB2A0 2500 2500
3 EX NM51B1A1 2600 2600
4 ENT W NM 2780 2780