Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF statements | Excel Discussion (Misc queries) | |||
IF Statements (Mutliple Statements) | Excel Worksheet Functions | |||
If Statements | Excel Discussion (Misc queries) | |||
If... Then statements | Excel Discussion (Misc queries) | |||
using if statements | Excel Worksheet Functions |