how to link one columns results to other columns results depending on a condition

%3CLINGO-SUB%20id%3D%22lingo-sub-2340522%22%20slang%3D%22en-US%22%3Ehow%20to%20link%20one%20columns%20results%20to%20other%20columns%20results%20depending%20on%20a%20condition%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2340522%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20formule%20could%20link%20column%20B%20to%20the%20results%20of%20columns%20D%20to%20R%2C%20depending%20on%20the%20year%20chosen%20in%20cell%20B3.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20very%20much%20in%20advance%2C%20Juan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2340522%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2340581%22%20slang%3D%22en-US%22%3ERe%3A%20how%20to%20link%20one%20columns%20results%20to%20other%20columns%20results%20depending%20on%20a%20condition%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2340581%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F145009%22%20target%3D%22_blank%22%3E%40juan%20jimenez%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDepends%20on%20which%20Excel%20you%20are%2C%20as%20variant%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DXLOOKUP(%24B%243%2C%24D%243%3A%24R%243%2C%24D%248%3A%24R%2460)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2340790%22%20slang%3D%22en-US%22%3ERe%3A%20how%20to%20link%20one%20columns%20results%20to%20other%20columns%20results%20depending%20on%20a%20condition%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2340790%22%20slang%3D%22en-US%22%3EHi%20Sergei%2C%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%20very%20much%20for%20your%20quick%20response.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20am%20using%20Excel%202016.%20Will%20xloolup%20work%3F%3CBR%20%2F%3E%3CBR%20%2F%3EAnother%20suggestion%20in%20case%20it%20doesn't%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2341000%22%20slang%3D%22en-US%22%3ERe%3A%20how%20to%20link%20one%20columns%20results%20to%20other%20columns%20results%20depending%20on%20a%20condition%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2341000%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F145009%22%20target%3D%22_blank%22%3E%40juan%20jimenez%3C%2FA%3E%26nbsp%3BNo%2C%20XLOOKUP()%20is%20not%20available%20for%202016.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20variant%2C%20in%20B8%20you%20may%20enter%20the%20formula%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DINDEX(%24D%248%3A%24R%2460%2C%200%2C%20MATCH(%24B%243%2C%24D%243%3A%24R%243%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3ESelect%20entire%20range%20B8%3AB60%2C%20in%20formula%20bar%20click%20at%20the%20end%20of%20the%20formula%20and%20re-enter%20it%20with%20Ctrl%2BShift%2BEnter.%20It%20will%20be%20expanded%20as%20an%20array%20on%20entire%20range.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAlternatively%20you%20may%20use%20in%20B8%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DINDEX(%24D8%3A%24R8%2C%201%2C%20MATCH(%24B%243%2C%24D%243%3A%24R%243%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Eand%20drag%20it%20down%20till%20end%20of%20the%20range.%20Re-apply%20formatting%20manually%20or%20by%20Format%20Painter%20from%20other%20column.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Contributor

Hi

 

What formule could link column B to the results of columns D to R, depending on the year chosen in cell B3.

 

Thank you very much in advance, Juan

5 Replies

@juan jimenez 

Depends on which Excel you are, as variant

=XLOOKUP($B$3,$D$3:$R$3,$D$8:$R$60)
Hi Sergei,

Thank you very much for your quick response.

I am using Excel 2016. Will xloolup work?

Another suggestion in case it doesn't?

@juan jimenez No, XLOOKUP() is not available for 2016.

 

As variant, in B8 you may enter the formula

=INDEX($D$8:$R$60, 0, MATCH($B$3,$D$3:$R$3,0))

Select entire range B8:B60, in formula bar click at the end of the formula and re-enter it with Ctrl+Shift+Enter. It will be expanded as an array on entire range.

 

Alternatively you may use in B8

=INDEX($D8:$R8, 1, MATCH($B$3,$D$3:$R$3,0))

and drag it down till end of the range. Re-apply formatting manually or by Format Painter from other column.

Dear Segei,

Your formula works perfectly.

Could you explain me what is the purpose of doing "elect entire range B8:B60, in formula bar click at the end of the formula and re-enter it with Ctrl+Shift+Enter. It will be expanded as an array on entire range."?

And what would be the difference with the second option?

thank you, Juan.

@juan jimenez 

Yes, with first option you expand an array on entire range.

With second option you copy the cell by this or that down, not only the formula but formatting as well.

 

However, above are some variants, each option you may perform by several ways. For example, for second option copy cell B8, select B8:B60, Paste->Paste special, select Formula, ok