X
xirx
Hi!
The seach/3 function searches for 'find_text' in
'within_text', starting at the 'start_nun's character:
SEARCH(find_text,within_text,start_num)
I need to find the first digit in a string. I guess,
search/3 does neither support regular expresseions,
no does it allow a function instead of a constant
'search_text'.
One way to find the first digit is this monster:
=MIN(
IF(ISNUMBER(SEARCH(0;D2));SEARCH(0;D2);9999);
IF(ISNUMBER(SEARCH(1;D2));SEARCH(1;D2);9999);
IF(ISNUMBER(SEARCH(2;D2));SEARCH(2;D2);9999);
IF(ISNUMBER(SEARCH(3;D2));SEARCH(3;D2);9999);
IF(ISNUMBER(SEARCH(4;D2));SEARCH(4;D2);9999);
IF(ISNUMBER(SEARCH(5;D2));SEARCH(5;D2);9999);
IF(ISNUMBER(SEARCH(6;D2));SEARCH(6;D2);9999);
IF(ISNUMBER(SEARCH(7;D2));SEARCH(7;D2);9999);
IF(ISNUMBER(SEARCH(8;D2));SEARCH(8;D2);9999);
IF(ISNUMBER(SEARCH(9;D2));SEARCH(9;D2);9999)
)
Any more efficient way to do a
search('[0-9]';D2) or search(isnumber();D2)
?
The seach/3 function searches for 'find_text' in
'within_text', starting at the 'start_nun's character:
SEARCH(find_text,within_text,start_num)
I need to find the first digit in a string. I guess,
search/3 does neither support regular expresseions,
no does it allow a function instead of a constant
'search_text'.
One way to find the first digit is this monster:
=MIN(
IF(ISNUMBER(SEARCH(0;D2));SEARCH(0;D2);9999);
IF(ISNUMBER(SEARCH(1;D2));SEARCH(1;D2);9999);
IF(ISNUMBER(SEARCH(2;D2));SEARCH(2;D2);9999);
IF(ISNUMBER(SEARCH(3;D2));SEARCH(3;D2);9999);
IF(ISNUMBER(SEARCH(4;D2));SEARCH(4;D2);9999);
IF(ISNUMBER(SEARCH(5;D2));SEARCH(5;D2);9999);
IF(ISNUMBER(SEARCH(6;D2));SEARCH(6;D2);9999);
IF(ISNUMBER(SEARCH(7;D2));SEARCH(7;D2);9999);
IF(ISNUMBER(SEARCH(8;D2));SEARCH(8;D2);9999);
IF(ISNUMBER(SEARCH(9;D2));SEARCH(9;D2);9999)
)
Any more efficient way to do a
search('[0-9]';D2) or search(isnumber();D2)
?