Unknown error when IFNA function contains two LINK functions

102 Views Asked by At

TLDR: Unknown error appears if you have a formula constructed like this:

IFNA(Link1;Link2)

However, below example works which is basically the same thing,

A1: Link1 
A2: IFNA(A1;Link2)

Edit: Formula in URLTEXT when IFNA function contains two LINK functions might be the culprit.

Any ideas why this might be?

Hi,

i am trying to make a dynamic link on cell C1. From a search string it looks through column A to find the search string on cell A1. I have added an IFNA function that checks if entery is missing in column A. If this happens then it looks for the search string A1 again but in column B.

The problem and unknown error,

when it matches with a string on column B then the dymanic link throws an error:

(Rough translation from swedish)

"file:///(long path)/ABCD%3F" is not an absolut URL that can be sent to an external program be opened."

However, each dynamic link works seperatly. It is when i combine them with the IFNA that this problem occur.

It seems like the constructed link is equal to the URLTEXT from the first lookup when it is supposed to be the row number from the second lookup.

I suspect this is the reason the link fails. I might be wrong though and i cant see why this would happen.

When breaking down the components into smaller parts all looks good:

Picture showing the setup and component breakdown Picture showing formulas

Below is the setup for replicating this issue. Formulas and their belonging cells:

A1 = "ABC"
A3 = "acol"
A4 = "AB"
A5 = "CD"
B3 = "bcol"
B3 = "ABCD"
B4 = "CDEF"
C3 = "acode"
D3 = "bcode"

Renamed cells:

lookup_search_cell = A1
lookup_code_arr = A4:D5
translated_lookup_search_cell = B1
lookup_acode_col = C4:C5
lookup_bcode_col = D4:D5

B1:

=CONCATENATE(,
IF(CODE(MID(UPPER(A1),1,1))=0,CODE(MID(UPPER(A1),1,1))),
IF(CODE(MID(UPPER(A1),2,1))=0,CODE(MID(UPPER(A1),2,1))),
IF(CODE(MID(UPPER(A1),3,1))=0,CODE(MID(UPPER(A1),3,1))),
IF(CODE(MID(UPPER(A1),4,1))=0,CODE(MID(UPPER(A1),4,1))))

C1:

=IF(lookup_search_cell="","Enter",

    IFNA(
        IFNA(
            LINK("#sheet1.$A$" & 
                MATCH(translated_lookup_search_cell&"*",lookup_acode_col,0)+3 & ":" & "$B$" & 
                MATCH(translated_lookup_search_cell&"*",lookup_acode_col,0)+3,

                IFERROR(
                    INDEX(lookup_code_arr,
                        MATCH(translated_lookup_search_cell&"*",lookup_acode_col,0),1
                    )&"?","Cant find acol entery"
                )
            ),

            LINK("#sheet1.$A$"&
                MATCH(translated_lookup_search_cell&"*",lookup_bcode_col,0)+3 & ":" & "$B$" & 
                MATCH(translated_lookup_search_cell&"*",lookup_bcode_col,0)+3,

                IFERROR(
                    INDEX(lookup_code_arr,
                        MATCH(translated_lookup_search_cell&"*",lookup_bcode_col,0),2
                    )&"?","Cant find bcol entery"
                )
            )
        ),"Cant find entery"
    )
)

C4:

=CONCATENATE(,
IF(CODE(MID(UPPER(A4),1,1))=0,CODE(MID(UPPER(A4),1,1))),
IF(CODE(MID(UPPER(A4),2,1))=0,CODE(MID(UPPER(A4),2,1))),
IF(CODE(MID(UPPER(A4),3,1))=0,CODE(MID(UPPER(A4),3,1))),
IF(CODE(MID(UPPER(A4),4,1))=0,CODE(MID(UPPER(A4),4,1))))

C5:

=CONCATENATE(,
IF(CODE(MID(UPPER(A5),1,1))=0,CODE(MID(UPPER(A5),1,1))),
IF(CODE(MID(UPPER(A5),2,1))=0,CODE(MID(UPPER(A5),2,1))),
IF(CODE(MID(UPPER(A5),3,1))=0,CODE(MID(UPPER(A5),3,1))),
IF(CODE(MID(UPPER(A5),4,1))=0,CODE(MID(UPPER(A5),4,1))))

D4:

=CONCATENATE(,
IF(CODE(MID(UPPER(B4),1,1))=0,CODE(MID(UPPER(B4),1,1))),
IF(CODE(MID(UPPER(B4),2,1))=0,CODE(MID(UPPER(B4),2,1))),
IF(CODE(MID(UPPER(B4),3,1))=0,CODE(MID(UPPER(B4),3,1))),
IF(CODE(MID(UPPER(B4),4,1))=0,CODE(MID(UPPER(B4),4,1))))

D5:

=CONCATENATE(,
IF(CODE(MID(UPPER(B5),1,1))=0,CODE(MID(UPPER(B5),1,1))),
IF(CODE(MID(UPPER(B5),2,1))=0,CODE(MID(UPPER(B5),2,1))),
IF(CODE(MID(UPPER(B5),3,1))=0,CODE(MID(UPPER(B5),3,1))),
IF(CODE(MID(UPPER(B5),4,1))=0,CODE(MID(UPPER(B5),4,1))))
1

There are 1 best solutions below

0
On

Sorry, i think this was a repost, found answer here. How to add multiple links in excel cell?

This question can be deleted. If true then thanks to Didier for the information.

Here is another solution instead if anyone find it interesting,

=OM(lookup_search_cell=""
;
    "Enter"
;

    LÄNK("#sheet1.$A$"&
        OMSAKNAS(
            PASSA(translated_lookup_search_cell&"*";lookup_acode_col;0)+3&":"&"$B$"&
            PASSA(translated_lookup_search_cell&"*";lookup_acode_col;0)+3
        ;
            PASSA(translated_lookup_search_cell&"*";lookup_bcode_col;0)+3&":"&"$B$"&
            PASSA(translated_lookup_search_cell&"*";lookup_bcode_col;0)+3
        )

    ;
        OMSAKNAS(
            INDEX(lookup_code_arr;
                PASSA(translated_lookup_search_cell&"*";lookup_acode_col;0);1
            )&"?"
            
        ;
            INDEX(lookup_code_arr;
                PASSA(translated_lookup_search_cell&"*";lookup_bcode_col;0);2
            )&"?"
        )
    )
)

Conclution, you cant have multiple links in the same cell but you can mold the one and only link to what you want it to be.