XLOOK-UP greater than

%3CLINGO-SUB%20id%3D%22lingo-sub-3182787%22%20slang%3D%22en-US%22%3EXLOOK-UP%20greater%20than%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3182787%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20the%20attached%20workbook%2C%20and%20I%20have%202%20problems%3A-%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1)%20I%20need%20to%20create%20a%20lookup%20(hopefully%20X)%20which%20will%20return%20multiple%20columns%2C%20say%20F%20%26amp%3B%20J%2C%20if%20their%20age%20is%20greater%20than%20a%20value%20in%20actual%20age%2C%20say%2040.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2)%20I%20would%20like%20to%20combine%20the%20formulas%20in%20columns%20G%20%26amp%3B%20H%2C%20so%20that%20it%20will%20work%20out%20from%20a%20date%20of%20birth%20someones%20age%2C%20but%20rounded%20down%2C%20like%20an%20age%20in%20the%20real%20world.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20thanks%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3182787%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-3182913%22%20slang%3D%22en-US%22%3ERe%3A%20XLOOK-UP%20greater%20than%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3182913%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F981308%22%20target%3D%22_blank%22%3E%40Robert1290%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20I%20recommend%20using%20filter%20instead%20of%20xlookup%20since%20you%20have%20office%20365.%3C%2FP%3E%3CTABLE%20width%3D%22549px%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%22548px%22%20height%3D%2230px%22%3EThe%20formula%20should%20be%20this%20for%20returning%20the%20name%20column%3A%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20width%3D%22548px%22%20height%3D%2230px%22%3E%3DFILTER(Table1%5BName%5D%2CTable1%5BActual%20Age%5D%26gt%3B%3D40%2C%22No%20record%22)%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20width%3D%22548px%22%20height%3D%2210px%22%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20width%3D%22548px%22%20height%3D%2230px%22%3EThe%20formula%20should%20be%20this%20for%20returning%20the%20reference%20column%3A%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20width%3D%22548px%22%20height%3D%2230px%22%3E%3DFILTER(Table1%5BReference%5D%2CTable1%5BActual%20Age%5D%26gt%3B%3D40%2C%22No%20record%22)%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E2.%26nbsp%3BYour%20use%20of%20'rounddown'%20is%20correct%20here%2C%20simply%20replace%20cell%20reference%20with%20the%20formula%20originally%20in%20%24D3.%3C%2FP%3E%3CP%3EActual%20Age%3C%2FP%3E%3CTABLE%20width%3D%22414%22%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%3DROUNDDOWN(((TODAY()-%5B%40%5BDay%20of%20Birth%5D%5D))%2F365.25%2C0)%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%3DROUNDDOWN(((TODAY()-%5B%40%5BDay%20of%20Birth%5D%5D))%2F365.25%2C0)%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%3DROUNDDOWN(((TODAY()-%5B%40%5BDay%20of%20Birth%5D%5D))%2F365.25%2C0)%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%3DROUNDDOWN(((TODAY()-%5B%40%5BDay%20of%20Birth%5D%5D))%2F365.25%2C0)%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20turned%20all%20of%20it%20into%20an%20official%20excel%20table%20so%20you'd%20see%20%5B%40...%5D%20for%20the%20references%2C%20change%20it%20back%20if%20you%20like.%20If%20I%20misunderstood%20your%20questions%2C%20please%20let%20me%20know.%20Hope%20it%20helps!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3182830%22%20slang%3D%22en-US%22%3ERe%3A%20XLOOK-UP%20greater%20than%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3182830%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F981308%22%20target%3D%22_blank%22%3E%40Robert1290%3C%2FA%3E%26nbsp%3BWith%20regard%20to%20point%202%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DROUNDDOWN(((TODAY()-I5))%2F365.25%2C0)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20take%20the%20formula%20from%20H5%2C%20without%20the%20%3D%20sign%2C%20and%20place%20it%20in%20the%20ROUNDDOWN%20function%20in%20stead%20of%20H5.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENot%20sure%20what%20you%20want%20in%20point%201.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Hi,

 

I have the attached workbook, and I have 2 problems:-

 

1) I need to create a lookup (hopefully X) which will return multiple columns, say F & J, if their age is greater than a value in actual age, say 40.

 

2) I would like to combine the formulas in columns G & H, so that it will work out from a date of birth someones age, but rounded down, like an age in the real world.

 

Many thanks in advance.

7 Replies

@Robert1290 With regard to point 2:

 

 

=ROUNDDOWN(((TODAY()-I5))/365.25,0)

 

 

You take the formula from H5, without the = sign, and place it in the ROUNDDOWN function in stead of H5.

 

Not sure what you want in point 1.

@ Riny_van_Eekelen thank you, that is so obvious now you have said it, and will help me in the future with other formulas.

For point 1, say if the actual age is more than 40, then I would like to return, say, their name and reference on to a new worksheet.

@Robert1290 

1. I recommend using filter instead of xlookup since you have office 365.

The formula should be this for returning the name column:
=FILTER(Table1[Name],Table1[Actual Age]>=40,"No record")
 
The formula should be this for returning the reference column:
=FILTER(Table1[Reference],Table1[Actual Age]>=40,"No record")

2. Your use of 'rounddown' is correct here, simply replace cell reference with the formula originally in $D3.

Actual Age

=ROUNDDOWN(((TODAY()-[@[Day of Birth]]))/365.25,0)
=ROUNDDOWN(((TODAY()-[@[Day of Birth]]))/365.25,0)
=ROUNDDOWN(((TODAY()-[@[Day of Birth]]))/365.25,0)
=ROUNDDOWN(((TODAY()-[@[Day of Birth]]))/365.25,0)

 

I turned all of it into an official excel table so you'd see [@...] for the references, change it back if you like. If I misunderstood your questions, please let me know. Hope it helps!

@Robert1290 If your Excel version supports it you can use the FILTER function. Otherwise, a simple pivot table could do it. Both demonstrated in the attached file on Sheet2

@Marcus123

Thanks, although I am a little confused, can I see this on the workbook that I have uploaded? Can you include the workbook but amended so I can understand it better? Thanks in advance.

@Robert1290 

 

Here is it with the comments. The pivot table solution is okay too but if you prefer formulas either way is okay.

@ Riny_van_Eekelen
@Marcus123

Thanks both, I didn't see the attached excel before. I will go with formulas as it will stop manual intervention with the workbooks I need it for. This has been very helpful and will allow me to continue my work.