Forum Discussion

Robert1290's avatar
Robert1290
Brass Contributor
Feb 18, 2022

XLOOK-UP greater than

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

  • Marcus123's avatar
    Marcus123
    Copper Contributor

    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's avatar
      Robert1290
      Brass Contributor
      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.
  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    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.

    • Robert1290's avatar
      Robert1290
      Brass Contributor

      @ 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.

Resources