Combine Two Array Formulas - excel

I have in (D2) very dirty string:
Ⱦ[ḫ]îs ɨs síṁƥḽẽ ~s?tring $with Ḑiă{cr}îtíc#s ẵɲd Ṧɏ<ṃƀǿⱡs. /123
To clean this I use two great formulas (Thanks #Jvdv)
First - Cleaning string from unwanted characters:
=TRIM(CONCAT(IF(MMULT(IFERROR(SEARCH("~"&MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);{"ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ"\"ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ /0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});0);{1;1});MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);" ")))
Only First formula return next:
Ⱦ ḫ îs ɨs síṁƥḽẽ s tring with Ḑiă cr îtíc s ẵɲd Ṧɏ ṃƀǿⱡs /123
Second - Converting diacritics to alphabetical:
=CONCAT(IFERROR(IF(EXACT(LOWER(MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1));MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1));LOWER(MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT";"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ");SEARCH("~"&MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ";"ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ"));1));MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT";"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ");FIND(MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ";"ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ"));1));MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1)))
Only Second formula return next:
T[h]is is simple ~s?tring $with Dia{cr}itic#s and Sy<mbols. /123
Both formulas (one after one) return next:
T i is is simple s tring with Dia cr itic s and sy mbols /123
I expect to see the same string, but with correct spacing:
This is simple string with Diacritics and Symbols /123
For this goal I combine both formulas in one single:
=SUBSTITUTE(CONCAT(IF(ISNUMBER(SEARCH("~"&MID(CONCAT(IFERROR(IF(EXACT(LOWER(MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1));MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1));LOWER(MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT";"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ");SEARCH("~"&MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ";"ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ"));1));MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT";"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ");FIND(MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ";"ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ"));1));MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1)));ROW(X$1:INDEX(X:X;LEN(CONCAT(IFERROR(IF(EXACT(LOWER(MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1));MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1));LOWER(MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT";"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ");SEARCH("~"&MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ";"ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ"));1));MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT";"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ");FIND(MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ";"ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ"));1));MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1))))));1);{" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}));MID(CONCAT(IFERROR(IF(EXACT(LOWER(MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1));MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1));LOWER(MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT";"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ");SEARCH("~"&MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ";"ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ"));1));MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT";"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ");FIND(MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ";"ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ"));1));MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1)));ROW(X$1:INDEX(X:X;LEN(CONCAT(IFERROR(IF(EXACT(LOWER(MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1));MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1));LOWER(MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT";"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ");SEARCH("~"&MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ";"ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ"));1));MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT";"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ");FIND(MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1);CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ";"ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ"));1));MID(D2;ROW(X$1:INDEX(X:X;LEN(D2)));1))))));1);"^^"));"^^";"")
And its working. But something is not right in my combination, because is an excessive long length.
I ask experts for a nicer, optimized combination of this two array formulas, using Excel-2019, without VBA or Helper Columns. Thank You.

To me the following worked:
Formula in A2:
=CONCAT(IFERROR(IF(EXACT(LOWER(MID(D2,ROW(X$1:INDEX(X:X,LEN(D2))),1)),MID(D2,ROW(X$1:INDEX(X:X,LEN(D2))),1)),LOWER(MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT","UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ"),SEARCH("~"&MID(D2,ROW(X$1:INDEX(X:X,LEN(D2))),1),CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ","ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ")),1)),MID(CONCATENATE("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBCCCCCCCCCDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGGGGGGGGGHHHHHHHHHIIIIIIIIIIIIIIIIIIIJKKKKKKKLLLLLLLLLLLLMMMNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPRRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTT","UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWWWWWWXXYYYYYYYYYYYYZZZZZZZ"),FIND(MID(D2,ROW(X$1:INDEX(X:X,LEN(D2))),1),CONCATENATE("ÁÀȦÄǍĀÃÅĄȺẤẦẮẰǠǺǞẪẴẢȀȂẨẲẠḀẬẶĂÂḂɃƁḄḆĆĊĈČÇȻḈƇƆḊĎḐĐƊḌḒḎÐƉÉÈĖÊËĚĔĒẼĘȨɆẾỀḖḔỄḜẺȄȆỂẸḘḚỆÉÈÊËḞƑǴĠĜǦĞḠĢǤƓḢĤḦȞḨĦḤḪⱧÍÌÏǏĬĪĨĮƗḮỈȈȊỊḬÍÌÏÎĴḰǨĶƘḲḴⱩĹĿĽⱢⱠĻȽŁḶḼḺḸḾṀṂŃǸṄŇÑŅƝṆṊṈÑŊÓÒȮÔÖǑŎŌÕǪŐỐỒƟØṒṐṌȪỖṎǾȬǬỎȌȎƠỔỌỚỜỠỘỞỢÓÒÔÖÕṔṖⱣƤŔṘŘŖɌⱤȐȒṚṞṜŚṠŜŠṤṦṢṨŞȘṪŤƬṬȚƮṰṮȾŢŦ","ÚÙÛÜǓŬŪŨŮŲŰɄǗǛṸṺỦȔȖƯỤṲỨỪṶṴỮỬỰÚÙÛÜṼṾẂẀẆŴẄẈẊẌÝỲẎŶŸȲỸɎỶƳỴÝŹŻẐŽƵẒẔ")),1)),IF(ISNUMBER(SEARCH("~"&MID(D2,ROW(X$1:INDEX(X:X,LEN(D2))),1),"/ 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")),MID(D2,ROW(X$1:INDEX(X:X,LEN(D2))),1),"")))
But granted, this is a painfull and seriously hard debugging for anyone if something come up that needs changing. Please don't ask me about it =)
Note: This worked with given sample data, but something simple like: Hello?You, will turn to HelloYou. Quite frankly, there is also simply no way to tell the difference in pure logic wheather or not you would want a space or not in this case if the input is this cluttered.

Related

How to retrieve number from string between "o=" and "&" characters in Ecxel?

I was surfing the net, looking for a solution on how to retrieve the number that I need from a string in Excel.
So I have this kinda string:
"somecharacterso=3242&morecharacters"
and I am trying to retrieve the "3242" number according to this https://www.ablebits.com/office-addins-blog/excel-regex-formulas/#functions
and stuck with this RegExp: o=\b(\d+)\b& but it extracts the full substring not the number only.
So, now tested and improved:
EDIT: based on comment to use "o=" and "&":
=MID(A1,FIND("o=",A1,1)+2,(FIND("&",A1,1)-FIND("o=",A1,1)-2))*1
Does exactly as asked.
=mid(A1,find("=",A1,1)+1,find("&",A1,1)-(find("=",A1,1)+1))*1
returns the 3242 as a number.
There's good style in Excel formulae as well as in programming languages, particularly for making the logic easily understandable to other people who use the file later.
So if the starting data is in A2:
In B2 put =FIND("o=",A2)
In C2 put =FIND("&",A2)
In D2 put =MID(A2,B2+2,C2-B2-2) * 1
Exactly the same logic as Solar Mike's answer, but for most people easier to follow, check, and amend if necessary in the future.
Formulae using native Excel functions (especially shortish ones) are understood by far more people than regex.

Evaluate long string (>255 characters) as array

So I quite often find myself doing tasks on Excel which involve evaluating a text string as an array. Generally speaking I just use this:
Function EVAL(Ref As String)
EVAL = Evaluate(Ref)
End Function
So the formula will be, for example:
=EVAL("{"&CHAR(34)&SUBSTITUTE(TEXTJOIN(";",TRUE,MID(Index[Industries],2,LEN(Index[Industries])-2)),";",CHAR(34)&";"&CHAR(34))&CHAR(34)&"}")
The cells in this example will have contents like:
;Automotive;Rail;Energy;
;Automotive;Rail;
;Energy;
;Automotive;Aerospace;
(As it happens this is the precise problem I'm stuck on right now, though it has come up in different ways in the past.)
This has worked for me in the past, but I've been running into difficulties lately.
I have come to the conclusion it isn't working because application.evaluate, it turns out, has a character limit of 255. I've seen examples of VBA tricks to bypass this for text strings that are formulas rather than arrays, but copy-pasting those they don't seem to work for when I'm using it to interpret a text string as an array rather than as a formula.
Is there some trick to get this to work? (Or, indeed, is there some alternative method to achieve this altogether?)
Right, as per my comments, if you are using ms365, you could avoid your workbook to be xlsm just because you need to split values into an array. Make use of what is available with native functions, for example:
Formula in C2:
=TEXTSPLIT(CONCAT(A1:A4),,";",1)
Formula in D2:
=FILTERXML("<t><s>"&SUBSTITUTE(CONCAT(A1:A4),";","</s><s>")&"</s></t>","//s[node()]")
Note 1: As per time of writing you'd need to enable the BETA-channel to gain access to TEXTSPLIT(), and if I recall correctly your version (2203) is allowed to start using this function. Just google how to get access and update your Excel.
Both options can obviously be nested inside the UNIQUE() function.
Note 2: If at any point CONCAT()'s limits are reached (32767 characters, thanks #ScottCraner), maybe you can avoid using that with help of the lambda's helper function REDUCE():
=TEXTSPLIT(REDUCE("",A1:A4,LAMBDA(a,b,a&b)),,";",1)
Note 3: In case you can't update your Excel just yet, and you wonder how to use FILTERXML(), don't mind me refering you to another post I wrote a while back here.

How to substring in Excel between different characters?

first-time poster so please bear with me. I am trying to convince Excel to do a substring and failing miserably. The task is simple enough on the surface of it, extract text that's between a fixed set of chars (+, -, * and /), basically mathematical operators.
My input string looks like this:
A+B+C+D
Now, if my string looks like that, or like A-B-C-D, all is good, I can use this and it works (not my code, found on https://exceljet.net/formula/split-text-with-delimiter and modified to suit my needs:
First text: TRIM(MID(SUBSTITUTE($A2,"+",REPT(" ",LEN($A2))),0*LEN($A2)+1,LEN($A2)))
Second: TRIM(MID(SUBSTITUTE($A2,"+",REPT(" ",LEN($A2))),1*LEN($A2)+1,LEN($A2)))
Third: TRIM(MID(SUBSTITUTE($A2,"+",REPT(" ",LEN($A2))),2*LEN($A2)+1,LEN($A2)))
Forth: TRIM(MID(SUBSTITUTE($A2,"+",REPT(" ",LEN($A2))),3*LEN($A2)+1,LEN($A2)))
And all is good, until I have a string like: A-B+C-D or wahtever combo, basically not all the same char.
I tried using Find and Search in different configurations, but I always come to the same problem:
Using substitute gives me the n'th occurance and that's no good as - may be my second symbol or third
Can't dynamically and accurately calculate the length for MID, as it does Nr. of chars, not "until"
I can't use VB script for security reasons, so I am stuck trying to use Excel formulas.
It HAS to be one formula, as in the end, it's part of a bigger formula that's something like this:
CONCATENATE(IF(ISNUMBER(A),A,VLOOKUP(A)),IF(ISNUMBER(A),A,VLOOKUP(A)),IF(ISNUMBER(A),A,VLOOKUP(A)),IF(ISNUMBER(A),A,VLOOKUP(A)))
So I have the input in a cell and my result has to do all the processing in an adjacent cell.
Thank you in advance, at whit's end over here.
You can try FILTERXML() function.
=TRANSPOSE(FILTERXML("<t><s>"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"+","|"),"-","|"),"*","|"),"/","|"),"|","</s><s>")&"</s></t>","//s"))
If you are not on Excel365 then try below formula.
=FILTERXML("<t><s>"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A1,"+","|"),"-","|"),"*","|"),"/","|"),"|","</s><s>")&"</s></t>","//s[" & COLUMN(A1) &"]")
To learn FILTERXML() go through this article from #JvdV
For lower versions of Excel following formula would work by copying across as much as needed:
=TRIM(MID(SUBSTITUTE(" "&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A1,"+"," "),"-"," "),"/"," "),"*"," ")," ",REPT(" ",99)),99*COLUMNS($A1:A1),99))
which is fairly similar to what has been posted on Exceljet site.

Attempting to extract one of two possible words from a text string if matches a criteria, or input the string in it's entirety

I'm trying to bring back one of two possible words (Local or National) from a text string, and if neither of these words are in the text string, then bring back the string in the whole cell
The issue I have is that I can bring back either word when they appear, but I get an error when they do not
I'm currently using
=IFERROR(IF(SEARCH("*local*",B2,1),"Local"),IF(SEARCH("*national*",B2,1),"National"))
However this obviously this doesn't bring back if the words not exist
I'm sure it's easy and I'm missing something, but I just cannot figure it out. any help would be great
Cheers all
You can use:
Formula in B1:
=IF(ISNUMBER(SEARCH("*local*",A1)),"Local",IF(ISNUMBER(SEARCH("*national*",A1)),"national",A1))
Drag down
Note:
Notice that your wildcards make it that even a string with 'international' in it will return 'national'. If this is not what you want, you should remove the wildcards.
You can also use INDEX/AGGREGATE:
=IFERROR(INDEX({"local","national"},AGGREGATE(15,7,ROW($1:$2)/(ISNUMBER(SEARCH({"local";"national"},A1))),1)),A1)
This will allow one to replace the both hard coded arrays with a range of cells that contain the outputs. If Local and National were in D1:D2 then you can use:
=IFERROR(INDEX($D:$D,AGGREGATE(15,7,ROW($D$1:$D$2)/(ISNUMBER(SEARCH($D$1:$D$2,A1))),1)),A1)
That way if the list gets bigger the formula does not.
I'd suggest regular expressions.
=IF(REGEXMATCH(A2,"(Local|National)"),REGEXEXTRACT(A2,"(Local|National)"),A2)

Finding the right range from excel table

What is the best way to find the right column for the travelled miles using visual basic coding or some excel function and return the price from that column? HLOOKUP can't be used here because the lookup value isn't exact and the ranges in the table are also not with specific intervals (If they were, I could use e.g. FLOOR(travelled miles/100)*100 and find the price with HLOOKUP). Obviously, it's easy to find the price manually with a small table but with a big table computer will be faster.
Note that, if x is between a and b, then MEDIAN(x,a,b)=x. Combine this with some nested IFs:
=IF(MEDIAN(B5,B1,C1-1)=B5,B2,IF(MEDIAN(B5,C1,D1-1)=B5,C2,IF(MEDIAN(B5,D1,E1-1)=B5,D2)))
I'm on my phone, so just done the first three cases, but hopefully you can see how it continues.
(should note you need to remove the dashes for this to work)
Edit:
I also want to answer your question in the comments above. You can use the following to keep the dash, but get a number to work with.
Assume cell A1 has got the value 10-. We can use the FIND function to work out where the - occurs and then use the LEFT function to only return the characters from before the dash:
=LEFT(A1,FIND("-",A1)-1)
This will return the value 10, but it will return it as a string, not a number - basically Excel will think it is text. To force Excel to consider it as a number, we can simply multiply the value by one. Our formula above therefore becomes:
=(LEFT(A1,FIND("-",A1)-1))*1
You may also see people use a double minus sign, like this:
=--LEFT(A1,FIND("-",A1)-1)
I don't recommend this because it's a bit complex, but combining with the formula above would give:
=IF(MEDIAN(B5,--LEFT(B1,FIND("-",B1)-1),--LEFT(C1,FIND("-",C1)-1)-1)=B5,B2,IF(MEDIAN(B5,--LEFT(C1,FIND("-",C1)-1,--LEFT(D1,FIND("-",D1)-1-1)=B5,C2,IF(MEDIAN(B5,--LEFT(D1,FIND("-",D1)-1,--LEFT(E1,FIND("-",E1)-1-1)=B5,D2)))

Resources