![]() |
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 |
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 |
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") |
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") |
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") |
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