Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Help needed nested conditional formula

If M6 contains "J" or "L"
if the third character in M6 is a "-"
I want S6 to contain ""X"
else, I want S6 to contain "Y"
else, I want S6 to contain "Z".

How do I write the formula?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default Help needed nested conditional formula

gcotterl wrote:
If M6 contains "J" or "L"
if the third character in M6 is a "-"
I want S6 to contain ""X"
else, I want S6 to contain "Y"
else, I want S6 to contain "Z".

How do I write the formula?



Option Explicit

Sub gcotterl()
Dim Check As String
Check = Range("M6").Value
If InStr(1, Check, "J") + InStr(1, Check, "L") 0 Then
If Mid(Check, 3, 1) = "-" Then
Range("S6").Value = "X"
Else
Range("S6").Value = "Y"
End If
Else
Range("S6").Value = "Z"
End If
End Sub
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
Help with nested conditional formula Lars-Åke Aspelin[_2_] Excel Discussion (Misc queries) 0 June 27th 09 07:07 PM
Can system time & date be nested in conditional formula? Masif Excel Worksheet Functions 1 February 25th 09 07:14 PM
Nested, Conditional, IF formula - fomatting disappears Gayle Excel Worksheet Functions 1 February 5th 09 02:40 AM
Nested Functions for Conditional Formatting Formula RandyH Excel Worksheet Functions 3 September 22nd 08 07:28 PM
Conditional/Nested Formula Kuliano Excel Worksheet Functions 4 March 18th 08 07:43 PM


All times are GMT +1. The time now is 08:47 PM.

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"