SOLVED

Excel formula

%3CLINGO-SUB%20id%3D%22lingo-sub-2510353%22%20slang%3D%22en-US%22%3EExcel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2510353%22%20slang%3D%22en-US%22%3E%3CP%3E1.%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3DIF((C10%3D%22%22)*(D10%3D%22%22)%2C%22%22%2CIF(C10%26gt%3BD10%2C%24B%2410%2C%24E%2410))%20this%20formula%20correctly%20fills%20G16%20with%20either%20B10%20or%20E10%20data.%3C%2FP%3E%3CP%3E2.%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BG17%20contains%20a%20graphic%20which%20is%20linked%20to%20a%20named%20range%20and%20which%20works%20fine%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3DINDEX('Linked%20Picture'!%24AA%2431%3A%24AA%2446%2C%20MATCH('Linked%20Picture'!%24G%2416%2C'Linked%20Picture'!%24Z%2431%3A%24Z%2446%2C0))%20this%20formula%20correctly%20picks%20a%20graphic%20depending%20on%20the%20value%20of%20G16%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20select%20the%20graphic%20in%20G17%20the%20code%20is%20%3DFlagLookup9%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20tried%20%3DIF(G16%3D%22%22%2C%22%22)%2CFlagLookup9%20-%20I%20want%20the%20code%20to%20check%20if%20G16%20is%20empty%20and%20if%20it%20is%20do%20nothing%20otherwise%20select%20the%20graphic%20referred%20to%20in%20FlagLookup9.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20try%20this%20I%20get%20a%20message%20%22This%20formula%20is%20missing%20a%20named%20reference%20or%20a%20defined%20name.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20pointers%20where%20I%20cam%20going%20wrong%3F%20Thanks.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2510353%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECommunity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2511272%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2511272%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F995268%22%20target%3D%22_blank%22%3E%40DennisMetro%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHello!%20You've%20posted%20your%20question%20in%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FCommunity-Discussion%2Fbd-p%2FCommunityQuestions%22%20target%3D%22_blank%22%3ETech%20Community%20Discussion%20space%2C%3C%2FA%3E%20which%20is%20intended%20for%20discussion%20around%20the%20Tech%20Community%20website%20itself%2C%20not%20product%20questions.%20I'm%20moving%20your%20question%20to%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel%2Fbd-p%2FExcelGeneral%22%20target%3D%22_self%22%3EExcel%20space%3C%2FA%3E-%20please%20post%20Excel%20questions%20here%20in%20the%20future.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2511548%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2511548%22%20slang%3D%22en-US%22%3Emaybe%20it%20is%20just%20a%20typo%20when%20you%20typed%20it%20here%20but%20you%20said%20the%20formula%20that%20is%20failing%20is%3A%3CBR%20%2F%3E%3DIF(G16%3D%22%22%2C%22%22)%2CFlagLookup9%3CBR%20%2F%3Ebut%20correct%20format%20is%3CBR%20%2F%3E%3DIF(G16%3D%22%22%2C%22%22%2CFlagLookup9)%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2511713%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2511713%22%20slang%3D%22en-US%22%3EThanks%20for%20you%20suggestion.%20When%20I%20copy%2Fpaste%20your%20function%20I%20get%20the%20same%20message.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2512411%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2512411%22%20slang%3D%22en-US%22%3EI%20don't%20know%20what%20FlagLookup9%20is%20and%20thought%20you%20were%20using%20it%20as%20reference%20to%20the%20upper%20equation%20but%20then%20based%20on%20your%20response%20...%3CBR%20%2F%3EAttaching%20the%20file%20(remove%20any%20confidential%2Fpersonal%20info)%20would%20help%20a%20lot.%3CBR%20%2F%3EBut%20if%20the%20equation%3A%3CBR%20%2F%3E%3DINDEX('Linked%20Picture'!%24AA%2431%3A%24AA%2446%2C%20MATCH('Linked%20Picture'!%24G%2416%2C'Linked%20Picture'!%24Z%2431%3A%24Z%2446%2C0))%3CBR%20%2F%3Eworked%20and%20now%20you%20just%20want%20to%20show%20blank%20if%20G16%20is%20blank%20then%3CBR%20%2F%3E%3DIF(G16%3D%22%22%2C%22%22%2CINDEX('Linked%20Picture'!%24AA%2431%3A%24AA%2446%2C%20MATCH('Linked%20Picture'!%24G%2416%2C'Linked%20Picture'!%24Z%2431%3A%24Z%2446%2C0)))%3CBR%20%2F%3Eshould%20do%20it.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2512505%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2512505%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BHi.%3C%2FP%3E%3CP%3EThanks%20again.%20I%20tried%20that%20but%20got%20no%20joy.%3C%2FP%3E%3CP%3EI'm%20guessing%20it%20may%20not%20be%20possible.%3C%2FP%3E%3CP%3EAt%20any%20rate%20the%20file%20is%20attached.%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20time.%20Dennis%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

1.      =IF((C10="")*(D10=""),"",IF(C10>D10,$B$10,$E$10)) this formula correctly fills G16 with either B10 or E10 data.

2.     G17 contains a graphic which is linked to a named range and which works fine

         =INDEX('Linked Picture'!$AA$31:$AA$46, MATCH('Linked Picture'!$G$16,'Linked Picture'!$Z$31:$Z$46,0)) this formula correctly picks a graphic depending on the value of G16

 

When I select the graphic in G17 the code is =FlagLookup9

 

I have tried =IF(G16="",""),FlagLookup9 - I want the code to check if G16 is empty and if it is do nothing otherwise select the graphic referred to in FlagLookup9.

 

When I try this I get a message "This formula is missing a named reference or a defined name."

 

Any pointers where I cam going wrong? Thanks.

 

 

 

11 Replies

@DennisMetro 

Hello! You've posted your question in the Tech Community Discussion space, which is intended for discussion around the Tech Community website itself, not product questions. I'm moving your question to the Excel space- please post Excel questions here in the future. 

Sorry for messing up. I just couldn't find here to post.
maybe it is just a typo when you typed it here but you said the formula that is failing is:
=IF(G16="",""),FlagLookup9
but correct format is
=IF(G16="","",FlagLookup9)
Thanks for you suggestion. When I copy/paste your function I get the same message.
I don't know what FlagLookup9 is and thought you were using it as reference to the upper equation but then based on your response ...
Attaching the file (remove any confidential/personal info) would help a lot.
But if the equation:
=INDEX('Linked Picture'!$AA$31:$AA$46, MATCH('Linked Picture'!$G$16,'Linked Picture'!$Z$31:$Z$46,0))
worked and now you just want to show blank if G16 is blank then
=IF(G16="","",INDEX('Linked Picture'!$AA$31:$AA$46, MATCH('Linked Picture'!$G$16,'Linked Picture'!$Z$31:$Z$46,0)))
should do it.

@mtarler Hi.

Thanks again. I tried that but got no joy.

I'm guessing it may not be possible.

At any rate the file is attached. 

Thanks for your time. Dennis

@DennisMetro 

As named formula you need to use any function which returns reference, that could be OFFSET, INDEX or XLOOKUP.

If XLOOKUP is available for you Excel, you may handle empty cells with it. First, add dummy picture at the end of your range with flags (in general it could be in any other place), like

image.png

I take blue to make it visible, after testing it could be change on any transparent shape of any form.

Next, add named formula as

=XLOOKUP('Linked Picture'!$O$28, 'Linked Picture'!$Z$31:$Z$46, 'Linked Picture'!$AA$31:$AA$46,'Linked Picture'!$AA$47)

Last parameters indicates what to return if nothing is found. I named it GetFlag. If country exists it gives

image.png

If empty cell with country name

image.png

Please check in attached file.

Thank you Sergei. I will try - I am not very advanced with this stuff! I have looked a bit but don't see how it can work as the Getflag is different from my FlagLookups (1 for each team). I was hoping I could do something like this:
input results in R6 and S6
gives me a value in L16 then
in L17 something like
=XLOOKUP(L16,Z31:Z46,AA31:AA46,"",0,)
I know this can lookup the value of L16 and check it against Z31:Z46 but then I want it to insert the matching flag to L16 or return nothing if L16 is empty. I know I can not just stick in AA31:AA46 and the rest as I have done here in my example. Anyway, I will keep thinking about it. Very many thanks for your help. Dennis
best response confirmed by DennisMetro (Contributor)
Solution

@DennisMetro 

You may add named formulas for each cell with flag, e.g. for L17

=XLOOKUP('Linked Picture'!$L$16, 'Linked Picture'!$Z$31:$Z$46, 'Linked Picture'!$AA$31:$AA$46,'Linked Picture'!$AA$47)

and for O17

=XLOOKUP('Linked Picture'!$O$16, 'Linked Picture'!$Z$31:$Z$46, 'Linked Picture'!$AA$31:$AA$46,'Linked Picture'!$AA$47)
Sergei, Thank you very much indeed. That works quite well. I will have to look at it in details to try to understand but I think I know how it ties up with the linked cell. I found that the place holder is best made the same colour as the empty background. Adjusting the transparency of the placeholder, say to 0, means the inserted image when the score is known is also transparent. At any rate you've helped me reach a more satisfying outcome. Although I understand a bit in Excel I always have a feeling that there is a better way or an easier, more logical way that I don't know. For example I still have to work out the underlying facts about linking graphics and the size compared to the cells; trying to make the placeholders a bit smaller in relation to the graphic being linked; and checking to see if when a result is entered and a subsequent game is populated with new teams - the names go in but the format doesn't. I'm guessing that to have the correct format the team names would also have to be treated almost like another set of graphics.
Anyways, thank you again very much for your knowledge and help. Dennis

@DennisMetro , you are welcome, glad it helped.

That's bit more practice, try with different variants for better understanding how it works. In general not a rocket science.