Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OR statements


I have the following formula in a cell:
=IF(MID(S1,16,1)="6","OK","RECHECK")

But I would like to include the possibility that the cell may be empty
in which case, this would also be OK. But I'm having troubl
incorporating an OR statement to say OR = blank, or something alon
those lines

--
bhaloonee
-----------------------------------------------------------------------
bhalooneel's Profile: http://www.excelforum.com/member.php...fo&userid=2402
View this thread: http://www.excelforum.com/showthread.php?threadid=37678

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default OR statements


Użytkownik "bhalooneel"
napisał w
wiadomości ...

I have the following formula in a cell:
=IF(MID(S1,16,1)="6","OK","RECHECK")

But I would like to include the possibility that the cell may be empty,
in which case, this would also be OK. But I'm having trouble
incorporating an OR statement to say OR = blank, or something along
those lines.



=IF(S1<"";(IF(MID(S1,16,1)="6","OK","RECHECK");"O K")

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default OR statements



Snake Plissken wrote:
Użytkownik "bhalooneel"
napisał w
wiadomości ....

I have the following formula in a cell:
=IF(MID(S1,16,1)="6","OK","RECHECK")

But I would like to include the possibility that the cell may be empty,
in which case, this would also be OK. But I'm having trouble
incorporating an OR statement to say OR = blank, or something along
those lines.



=IF(S1<"";(IF(MID(S1,16,1)="6","OK","RECHECK");"O K")


Or...

=IF(OR(MID(S1,16,1)="6",S1=""),"OK","RECHECK")

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default OR statements

Not to be pedantic but len(S1) is preferable to S1<"".

Excel uses what are known as Pascal strings. With Pascal strings, the
length of the string is stored at the beginning of the string. So for
long strings, len() doesn't need to walk the length of the string for
the comparison.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default OR statements



Snake Plissken wrote:
Użytkownik "bhalooneel"
napisał w
wiadomości ....

I have the following formula in a cell:
=IF(MID(S1,16,1)="6","OK","RECHECK")

But I would like to include the possibility that the cell may be empty,
in which case, this would also be OK. But I'm having trouble
incorporating an OR statement to say OR = blank, or something along
those lines.



=IF(S1<"";(IF(MID(S1,16,1)="6","OK","RECHECK");"O K")


Or...

=IF(OR(MID(S1,16,1)="6",S1=""),"OK","RECHECK")



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default OR statements

Please try:

=IF(or(s1="",MID(S1,16,1)="6"),"OK","RECHECK")

--
Regards,

Martin


"bhalooneel" wrote:


I have the following formula in a cell:
=IF(MID(S1,16,1)="6","OK","RECHECK")

But I would like to include the possibility that the cell may be empty,
in which case, this would also be OK. But I'm having trouble
incorporating an OR statement to say OR = blank, or something along
those lines.


--
bhalooneel
------------------------------------------------------------------------
bhalooneel's Profile: http://www.excelforum.com/member.php...o&userid=24023
View this thread: http://www.excelforum.com/showthread...hreadid=376781


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
IF statements oatjes Excel Discussion (Misc queries) 4 May 30th 08 07:08 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
If Statements Dbettini Excel Discussion (Misc queries) 1 March 22nd 06 06:22 PM
If... Then statements BaldySlaphead Excel Discussion (Misc queries) 1 March 21st 06 11:53 AM
using if statements LAybar Excel Worksheet Functions 4 March 20th 06 02:55 PM


All times are GMT +1. The time now is 02:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright Š2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"