PC Review


Reply
Thread Tools Rate Thread

Conditional formula containing text and wildcard

 
 
PMo
Guest
Posts: n/a
 
      26th Aug 2008
This is a rather complicated equation (at least to me). I am trying to
create a conditional formula that will recognize partial text with a wildcard
* and then perform mathematical function based on what is in the text else
perform a different function.

The whole text will always start with a number of 1-3 digits and then always
contain the letters "ECL" and then end with "SST" or "STM" - examples would
be: "9ECLSTM" "10.5ECLSST". OR the text will start with a number of 3 digits
and then always contain the letters "BTL-SA" - examples: "220BTL-SA" or
"210BTL-SA"

Here is the current formula:
=ROUNDDOWN(((E80-(E81*'Global settings'!$A$33))/(E79+E78)*'Global
settings'!$A$29)*E8,0)

I want to add a condition that if the text in E7 contains "*ECL*" or
"*BTL-SA", then perform the formula above, else perform this formula:
ROUNDDOWN((E80-E81)/(E79+E78)*'Global settings'!$A$29)*E8,0)

The formulas I've tried don't seem to recognize the * as I've place them.
Can someone please help me?



 
Reply With Quote
 
 
 
 
ShaneDevenshire
Guest
Posts: n/a
 
      26th Aug 2008


You could use FIND or SEARCH:

=IF(ISERR(FIND("ECL",D15)),first formula,second formula)

You'll need to modify the IF to include and OR.

--
Cheers,
Shane Devenshire


"PMo" wrote:

> This is a rather complicated equation (at least to me). I am trying to
> create a conditional formula that will recognize partial text with a wildcard
> * and then perform mathematical function based on what is in the text else
> perform a different function.
>
> The whole text will always start with a number of 1-3 digits and then always
> contain the letters "ECL" and then end with "SST" or "STM" - examples would
> be: "9ECLSTM" "10.5ECLSST". OR the text will start with a number of 3 digits
> and then always contain the letters "BTL-SA" - examples: "220BTL-SA" or
> "210BTL-SA"
>
> Here is the current formula:
> =ROUNDDOWN(((E80-(E81*'Global settings'!$A$33))/(E79+E78)*'Global
> settings'!$A$29)*E8,0)
>
> I want to add a condition that if the text in E7 contains "*ECL*" or
> "*BTL-SA", then perform the formula above, else perform this formula:
> ROUNDDOWN((E80-E81)/(E79+E78)*'Global settings'!$A$29)*E8,0)
>
> The formulas I've tried don't seem to recognize the * as I've place them.
> Can someone please help me?
>
>
>

 
Reply With Quote
 
Pete_UK
Guest
Posts: n/a
 
      26th Aug 2008
Try something like this:

=IF(OR(ISNUMBER(FIND("ECL",E7)),ISNUMBER(FIND("BTL-
SA",E7))),first_formula,second_formula)

Hope this helps.

Pete


On Aug 26, 5:43*pm, PMo <P...@discussions.microsoft.com> wrote:
> This is a rather complicated equation (at least to me). *I am trying to
> create a conditional formula that will recognize partial text with a wildcard
> * and then perform mathematical function based on what is in the text else
> perform a different function.
>
> The whole text will always start with a number of 1-3 digits and then always
> contain the letters "ECL" and then end with "SST" or "STM" - examples would
> be: "9ECLSTM" "10.5ECLSST". *OR the text will start with a number of 3 digits
> and then always contain the letters "BTL-SA" - examples: "220BTL-SA" or
> "210BTL-SA"
>
> Here is the current formula:
> =ROUNDDOWN(((E80-(E81*'Global settings'!$A$33))/(E79+E78)*'Global
> settings'!$A$29)*E8,0)
>
> I want to add a condition that if the text in E7 contains "*ECL*" or
> "*BTL-SA", then perform the formula above, else perform this formula:
> ROUNDDOWN((E80-E81)/(E79+E78)*'Global settings'!$A$29)*E8,0)
>
> The formulas I've tried don't seem to recognize the * as I've place them.*
> Can someone please help me?


 
Reply With Quote
 
PMo
Guest
Posts: n/a
 
      27th Aug 2008
Thank you both for the quick response and great suggestions. I will give
them a try and let you know how it works out!

PMo

"Pete_UK" wrote:

> Try something like this:
>
> =IF(OR(ISNUMBER(FIND("ECL",E7)),ISNUMBER(FIND("BTL-
> SA",E7))),first_formula,second_formula)
>
> Hope this helps.
>
> Pete
>
>
> On Aug 26, 5:43 pm, PMo <P...@discussions.microsoft.com> wrote:
> > This is a rather complicated equation (at least to me). I am trying to
> > create a conditional formula that will recognize partial text with a wildcard
> > * and then perform mathematical function based on what is in the text else
> > perform a different function.
> >
> > The whole text will always start with a number of 1-3 digits and then always
> > contain the letters "ECL" and then end with "SST" or "STM" - examples would
> > be: "9ECLSTM" "10.5ECLSST". OR the text will start with a number of 3 digits
> > and then always contain the letters "BTL-SA" - examples: "220BTL-SA" or
> > "210BTL-SA"
> >
> > Here is the current formula:
> > =ROUNDDOWN(((E80-(E81*'Global settings'!$A$33))/(E79+E78)*'Global
> > settings'!$A$29)*E8,0)
> >
> > I want to add a condition that if the text in E7 contains "*ECL*" or
> > "*BTL-SA", then perform the formula above, else perform this formula:
> > ROUNDDOWN((E80-E81)/(E79+E78)*'Global settings'!$A$29)*E8,0)
> >
> > The formulas I've tried don't seem to recognize the * as I've place them.
> > Can someone please help me?

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional formula with text Mike Microsoft Excel Worksheet Functions 1 3rd Dec 2009 11:12 PM
Text Box with conditional formula Keyrookie Microsoft Excel Worksheet Functions 4 27th Nov 2009 04:40 PM
Text Box with conditional formula Keyrookie Microsoft Excel Worksheet Functions 0 27th Nov 2009 06:00 AM
Conditional formula if content is text a m spock Microsoft Excel Programming 6 21st Dec 2008 04:27 AM
Wildcard for any number in conditional formula Studebaker Microsoft Excel Misc 3 8th Apr 2008 02:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:56 PM.