Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ant Ant is offline
external usenet poster
 
Posts: 53
Default Wildcards in IF statement

I'm trying to use a IF statement to determine if a text of 4 characters
second digit is a 2 to say "Happy" else "Sad". Ex. if "0204" then "Happy",
"Sad".

I can't get the wildcard characters to work.
--
Thank you,
Ant
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Wildcards in IF statement

=IF(MID(F23,2,1)="2","Happy","Sad")
--
If this post helps click Yes
---------------
Jacob Skaria


"Ant" wrote:

I'm trying to use a IF statement to determine if a text of 4 characters
second digit is a 2 to say "Happy" else "Sad". Ex. if "0204" then "Happy",
"Sad".

I can't get the wildcard characters to work.
--
Thank you,
Ant

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Wildcards in IF statement

Try

=IF(MID(A1,2,1)="2","Happy","Sad")

Mike

"Ant" wrote:

I'm trying to use a IF statement to determine if a text of 4 characters
second digit is a 2 to say "Happy" else "Sad". Ex. if "0204" then "Happy",
"Sad".

I can't get the wildcard characters to work.
--
Thank you,
Ant

  #4   Report Post  
Posted to microsoft.public.excel.misc
Ant Ant is offline
external usenet poster
 
Posts: 53
Default Wildcards in IF statement

Yes this works. Thanks.
--
Thank you,
Ant


"Mike H" wrote:

Try

=IF(MID(A1,2,1)="2","Happy","Sad")

Mike

"Ant" wrote:

I'm trying to use a IF statement to determine if a text of 4 characters
second digit is a 2 to say "Happy" else "Sad". Ex. if "0204" then "Happy",
"Sad".

I can't get the wildcard characters to work.
--
Thank you,
Ant

  #5   Report Post  
Posted to microsoft.public.excel.misc
Ant Ant is offline
external usenet poster
 
Posts: 53
Default Wildcards in IF statement

This works and I think it would work better than me using =LEFT and OR
statements.
--
Thank you,
Ant


"Jacob Skaria" wrote:

=IF(MID(F23,2,1)="2","Happy","Sad")
--
If this post helps click Yes
---------------
Jacob Skaria


"Ant" wrote:

I'm trying to use a IF statement to determine if a text of 4 characters
second digit is a 2 to say "Happy" else "Sad". Ex. if "0204" then "Happy",
"Sad".

I can't get the wildcard characters to work.
--
Thank you,
Ant



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Wildcards in IF statement

You could use Left() if you wished, and return the same results:

=IF(LEFT(RIGHT(A1,3))="2","Happy","Sad")
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Ant" wrote in message
...
This works and I think it would work better than me using =LEFT and OR
statements.
--
Thank you,
Ant


"Jacob Skaria" wrote:

=IF(MID(F23,2,1)="2","Happy","Sad")
--
If this post helps click Yes
---------------
Jacob Skaria


"Ant" wrote:

I'm trying to use a IF statement to determine if a text of 4 characters
second digit is a 2 to say "Happy" else "Sad". Ex. if "0204" then
"Happy",
"Sad".

I can't get the wildcard characters to work.
--
Thank you,
Ant



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
use of wildcards italiavb Excel Worksheet Functions 5 July 14th 06 05:48 AM
Wildcards in RTD JKC Excel Discussion (Misc queries) 0 February 3rd 06 07:35 PM
Use wildcards furia Excel Discussion (Misc queries) 0 November 16th 05 06:23 PM
wildcards in vba shellshock Excel Discussion (Misc queries) 3 July 21st 05 07:37 PM
VBA Wildcards - HELP! Co-op Bank Charts and Charting in Excel 1 March 30th 05 02:37 PM


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