Help with lookup function

%3CLINGO-SUB%20id%3D%22lingo-sub-2374658%22%20slang%3D%22en-US%22%3EHelp%20with%20lookup%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2374658%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20running%20Windows%2010%20and%20Office%202016.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20files%20attached%20I%20am%20needing%20to%20look%20up%20the%20minimum%20push%20up%20(PU%20MIN)%2C%20minimum%20sit%20up%20score%20(SU%20MIN)%2C%20%26amp%3B%20the%20maximum%20time%20for%20the%202%20mile%20run%20(Max%20Time).%20The%20requirement%20is%2060%25%20in%20each%20exercise%20and%20that%20is%20based%20on%20the%20age%20and%20gender.%20I%20have%20all%20that%20info%20on%20the%20sheet%20I%20can't%20seem%20to%20find%20the%20correct%20formula%20to%20reference%20the%20gender%20and%20age%20and%20then%20lookup%20what%20a%2060%25%20score%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2374658%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377238%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20lookup%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377238%22%20slang%3D%22en-US%22%3EHelp%20me%20(and%20presumably%20others)%20interpret%20your%20score%20sheets.%20It's%20easy%20to%20tell%20apart%20the%20sections%20that%20refer%20to%20gender%2C%20but%20it's%20not%20clear%20(at%20least%20not%20to%20me)%20how%20the%20column%20and%20row%20headers%20refer%20to%20age....so%20if%20you%20could%20walk%20through%20in%20English%20(i.e.%2C%20in%20words)%20what%20you%20would%20do%20if%20doing%20this%20identification%20of%2C%20say%2C%20minimum%20sit%20up%20score%20for%20male%20at%20age%2021.%20What's%20the%20range%20of%20numbers%20there%2C%20how%20would%20they%20be%20identified%20(visually%2C%20in%20words)%20from%20which%20the%20minimum%20is%20to%20be%20selected%3F%20I%20know%20it's%20clear%20to%20you%2C%20and%20maybe%20it's%20something%20obvious%20that%20I'm%20missing.%20I%20suspect%20the%20formula%20will%20be%20fairly%20straightforward%2C%20but%20I%20need%20to%20know%20how%20to%20navigate%20that%20array%20of%20numbers.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377419%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20lookup%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377419%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1059705%22%20target%3D%22_blank%22%3E%40jletendre12%3C%2FA%3E%26nbsp%3Bhere%20is%201%20solution%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DLET(tbl%2CCHOOSE(1%2B(%24C2%3D%22F%22)%2CM_PU_Scores%2CF_PU_Scores)%2Cv%2CXLOOKUP(60%2CINDEX(tbl%2C%2CMATCH(%24E2%2CVALUE(OFFSET(tbl%2C-1%2C0%2C1))))%2COFFSET(tbl%2C%2C-1%2C%2C1)%2C%22na%22%2C1)%2Cv)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Eand%20then%20update%20M_PU_Scores%20and%20F_PU_Scores%20for%20each%20category%20(see%20attached%20sheet)%3C%2FP%3E%3CP%3Eso%20I%20made%20the%20formula%20to%20'fit'%20the%20named%20ranges%20you%20already%20had%2C%20but%20it%20turned%20out%20I%20had%20to%20fix%20all%20those%20names%20because%20they%20were%20referring%20to%20your%20local%20sheet%20(i'm%20guessing%20you%20made%20a%20copy%20but%20the%20names%20still%20ref%20the%20original%20workbook%20with%20slightly%20different%20sheet%20names).%26nbsp%3B%20The%20formula%20is%20a%20little%20wonky%20because%20I%20use%20offset%20with%20-1%20to%20get%20the%20header%20(age)%20row%20and%20the%20row%20index%20column%20(count).%3C%2FP%3E%3CP%3EIn%20any%20case%20if%20you%20want%20to%20know%20what%20is%20happening%2C%20the%20LET%20statement%20allows%20me%20to%20define%20a%20variable%20and%20in%20case%20that%20is%20to%20set%20tbl%20to%20either%20the%20male%20or%20female%20table.%26nbsp%3B%20next%20I%20set%20'v'%20to%20the%20answer%20and%20lastly%20I%20display%20V.%26nbsp%3B%20As%20for%20how%20i%20calc%20'v'%20it%20is%20a%20lookup%20for%20the%20value%20of%2060%20in%20the%20column%20that%20matches%20the%20age%20and%20then%20return%20the%20count.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20works%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2380055%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20lookup%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2380055%22%20slang%3D%22en-US%22%3EThank%20you%20for%20your%20help.%3C%2FLINGO-BODY%3E
New Contributor

I am running Windows 10 and Office 2016. 

 

In the files attached I am needing to look up the minimum push up (PU MIN), minimum sit up score (SU MIN), & the maximum time for the 2 mile run (Max Time). The requirement is 60% in each exercise and that is based on the age and gender. I have all that info on the sheet I can't seem to find the correct formula to reference the gender and age and then lookup what a 60% score 

3 Replies
Help me (and presumably others) interpret your score sheets. It's easy to tell apart the sections that refer to gender, but it's not clear (at least not to me) how the column and row headers refer to age....so if you could walk through in English (i.e., in words) what you would do if doing this identification of, say, minimum sit up score for male at age 21. What's the range of numbers there, how would they be identified (visually, in words) from which the minimum is to be selected? I know it's clear to you, and maybe it's something obvious that I'm missing. I suspect the formula will be fairly straightforward, but I need to know how to navigate that array of numbers.

@jletendre12 here is 1 solution:

=LET(tbl,CHOOSE(1+($C2="F"),M_PU_Scores,F_PU_Scores),v,XLOOKUP(60,INDEX(tbl,,MATCH($E2,VALUE(OFFSET(tbl,-1,0,1)))),OFFSET(tbl,,-1,,1),"na",1),v)

and then update M_PU_Scores and F_PU_Scores for each category (see attached sheet)

so I made the formula to 'fit' the named ranges you already had, but it turned out I had to fix all those names because they were referring to your local sheet (i'm guessing you made a copy but the names still ref the original workbook with slightly different sheet names).  The formula is a little wonky because I use offset with -1 to get the header (age) row and the row index column (count).

In any case if you want to know what is happening, the LET statement allows me to define a variable and in case that is to set tbl to either the male or female table.  next I set 'v' to the answer and lastly I display V.  As for how i calc 'v' it is a lookup for the value of 60 in the column that matches the age and then return the count.  

Hope this works

Thank you for your help.