ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   OR statements (https://www.excelbanter.com/excel-programming/331043-statements.html)

bhalooneel[_4_]

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


Martin[_21_]

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



Snake Plissken[_2_]

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")


[email protected]

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")


[email protected]

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")


Nick Hebb

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.



All times are GMT +1. The time now is 08:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com