Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 128
Default Calculation based on certain criteria

If M2 contains the word "travel", then I want to perform the following
calculation on S2:
=S2/117.5*100

If M2 does not contain the word "travel", then I want to perform the
following on S2:
=S2/105*100.

What is the best way of writing this in a formula?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Calculation based on certain criteria

Try

=IF(M2="Travel",S2/117.5*100,S2/105*100)

Mike

"Sarah (OGI)" wrote:

If M2 contains the word "travel", then I want to perform the following
calculation on S2:
=S2/117.5*100

If M2 does not contain the word "travel", then I want to perform the
following on S2:
=S2/105*100.

What is the best way of writing this in a formula?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 128
Default Calculation based on certain criteria

Thanks Mike, but M2 won't specifically just say "Travel", it will contain the
word "travel" if it says it at all, which is what I'm stuggling with.

"Mike H" wrote:

Try

=IF(M2="Travel",S2/117.5*100,S2/105*100)

Mike

"Sarah (OGI)" wrote:

If M2 contains the word "travel", then I want to perform the following
calculation on S2:
=S2/117.5*100

If M2 does not contain the word "travel", then I want to perform the
following on S2:
=S2/105*100.

What is the best way of writing this in a formula?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Calculation based on certain criteria

Hi,

Try this

=IF(ISNUMBER(SEARCH("travel",M2,1)),S2/117.5*100,S2/105*100)


--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Sarah (OGI)" wrote in message
...
If M2 contains the word "travel", then I want to perform the following
calculation on S2:
=S2/117.5*100

If M2 does not contain the word "travel", then I want to perform the
following on S2:
=S2/105*100.

What is the best way of writing this in a formula?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Calculation based on certain criteria

=IF(ISERROR(SEARCH("travel",M2)),S2/105*100,S2/117.5*100)

"Sarah (OGI)" wrote:

Thanks Mike, but M2 won't specifically just say "Travel", it will contain the
word "travel" if it says it at all, which is what I'm stuggling with.

"Mike H" wrote:

Try

=IF(M2="Travel",S2/117.5*100,S2/105*100)

Mike

"Sarah (OGI)" wrote:

If M2 contains the word "travel", then I want to perform the following
calculation on S2:
=S2/117.5*100

If M2 does not contain the word "travel", then I want to perform the
following on S2:
=S2/105*100.

What is the best way of writing this in a formula?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Calculation based on certain criteria

Or =IF(ISERROR(SEARCH("travel",M2)),105,117.5)*S2/100
--
David Biddulph

"Mike H" wrote in message
...
=IF(ISERROR(SEARCH("travel",M2)),S2/105*100,S2/117.5*100)

"Sarah (OGI)" wrote:

Thanks Mike, but M2 won't specifically just say "Travel", it will contain
the
word "travel" if it says it at all, which is what I'm stuggling with.

"Mike H" wrote:

Try

=IF(M2="Travel",S2/117.5*100,S2/105*100)

Mike

"Sarah (OGI)" wrote:

If M2 contains the word "travel", then I want to perform the
following
calculation on S2:
=S2/117.5*100

If M2 does not contain the word "travel", then I want to perform the
following on S2:
=S2/105*100.

What is the best way of writing this in a formula?



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Calculation based on certain criteria

=IF(COUNTIF(M2,"*travel*"),S2/117.5*100,S2/105*100)


"Sarah (OGI)" wrote:

If M2 contains the word "travel", then I want to perform the following
calculation on S2:
=S2/117.5*100

If M2 does not contain the word "travel", then I want to perform the
following on S2:
=S2/105*100.

What is the best way of writing this in a formula?

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 128
Default Calculation based on certain criteria

This worked a treat, many thanks!!

"Mike H" wrote:

=IF(ISERROR(SEARCH("travel",M2)),S2/105*100,S2/117.5*100)

"Sarah (OGI)" wrote:

Thanks Mike, but M2 won't specifically just say "Travel", it will contain the
word "travel" if it says it at all, which is what I'm stuggling with.

"Mike H" wrote:

Try

=IF(M2="Travel",S2/117.5*100,S2/105*100)

Mike

"Sarah (OGI)" wrote:

If M2 contains the word "travel", then I want to perform the following
calculation on S2:
=S2/117.5*100

If M2 does not contain the word "travel", then I want to perform the
following on S2:
=S2/105*100.

What is the best way of writing this in a formula?

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
Countif with multiple criteria (incl. calculation) DLF1 Excel Worksheet Functions 3 November 13th 08 05:51 PM
Ignore calculation when criteria exceeds 12 Sarah (OGI) Excel Discussion (Misc queries) 5 October 30th 08 03:45 PM
Calculation based on date Jack Excel Discussion (Misc queries) 3 March 22nd 06 08:17 AM
calculation based on meeting two criteria jerry Excel Discussion (Misc queries) 2 October 7th 05 12:35 AM
Calculation based on a condition mac_see Excel Worksheet Functions 3 April 22nd 05 01:24 AM


All times are GMT +1. The time now is 04:42 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"