Created
January 28, 2019 22:59
-
-
Save JeancarloFontalvo/f656eb3ad7668daf89ffbb96f95b7df9 to your computer and use it in GitHub Desktop.
Formula for validating a cell with the J2 Format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- J2 = "Alfanumerico|6|SI|SI|Personalizado" | |
--FORMULA | |
=Y( | |
SI( | |
SI.ERROR(HALLAR("Alfa"; J2); -1) <> -1; | |
VERDADERO; | |
SI( | |
SI.ERROR(HALLAR("Numerico"; J2); -1) <> -1; | |
REGEXMATCH(TO_TEXT(K2); "^(\d+)$"); | |
SI( | |
SI.ERROR(HALLAR("Fecha"; J2); -1) <> -1; | |
REGEXMATCH(TO_TEXT(K2);"^(19|20)\d{2}[\/](0[1-9]|1[0-2])[\/](0[1-9]|[12]\d|3[01])$"); | |
SI( | |
SI.ERROR(HALLAR("Hora"; J2); -1) <> -1; | |
REGEXMATCH(TO_TEXT(K2); "^(((0|1)[0-9])|2[0-3]):[0-5][0-9]$"); | |
VERDADERO | |
) | |
) | |
) | |
); | |
LARGO(TO_TEXT(K2)) <= INDICE(SPLIT(J2; "|"); 0; 2); | |
SI( | |
O(SI.ERROR(HALLAR("Obligatorio"; J2); -1) <> -1; SI.ERROR(HALLAR("Personalizado"; J2); -1) <> -1); | |
NO(ESBLANCO(K2)); | |
VERDADERO | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment