+ Reply to Thread
Results 1 to 6 of 6

Help with complex (to me) XLOOKUP function to create interactive table

  1. #1
    Registered User
    Join Date
    09-28-2020
    Location
    Virginia Beach, VA
    MS-Off Ver
    Excel Version 16.0.13127.20402
    Posts
    4

    Help with complex (to me) XLOOKUP function to create interactive table

    Good evening! I am new to this forum, as I usually do not attempt anything complex enough that I can't find it by Googling. However, I am trying to create a customizable workout plan for my unit to follow at home. I have exercises, skill level, and equipment needed in one table, labeled Exercises, and then I linked checkboxes (for multiple equipment items the person might have) and a drop-down to choose a skill level, to lists in the third tab (labeled Lists). Now I am trying to have the following XLOOKUP function match the user-selected equipment and skill level, look up exercises in the Exercises table, and return them into the shell Workout Plan table on the first tab.

    =XLOOKUP(1, (Exercise_Table[SkillLevel]=WorkoutPlan!$C$4) * ((Exercise_Table[Equipment]="*"&Lists!$D$9&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$10&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$11&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$12&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$13&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$14&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$15&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$16&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$17&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$18&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$19&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$20&"*") + (Exercise_Table[Equipment]="*"&Lists!$D$21&"*")), Exercise_Table[Monday], " ",2 )

    I am using wildcards so that I can have lists of different equipment that can be used for each exercise, and XLOOKUP can still match one equipment item with one selected by the user. By using the "+" I hoped it would function like an "OR", so that if any one equipment item selected by the user is found in the list, then that exercise will be returned. Can anyone see how to fix this? It looks like it should work according to the examples I have found on Google, but it just gives me nothing (the error state that I chose).

    Thank you all in advance!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-19-2019
    Location
    Illinois, USA
    MS-Off Ver
    365
    Posts
    57

    Re: Help with complex (to me) XLOOKUP function to create interactive table

    In my opinion - this seems pretty complex. There are some real wizards here, though, so maybe someone has a brilliant formula to make all of this work.

    This would be much simpler, IMO, to accomplish with some VBA & a userform.

    Your checkboxes & skill level selector = the form, and based on the options selected, VBA will populate a range on the "Workout Plan" tab with the predefined information from your "Exercises" tab.

    When I get off work, if nobody has responded, I'll do my best to take a stab at it -- one observation to leave you with, however is that I notice your "exercises" list is not including all possible combinations of exercises.

    For example - if I choose "Skill Level 1" but select 90 pound sled - there is no option for me, that I can see (maybe im looking at it wrong?)

    If this is the case, then you might consider limiting the selections the user can make (checkboxes) based on the skill level.

    So, if for example the 90 pound sled option is for skill level 3 only, then only have it appear as a skill level 3.

    This would make the # of options you have to account for a little easier.

  3. #3
    Registered User
    Join Date
    09-28-2020
    Location
    Virginia Beach, VA
    MS-Off Ver
    Excel Version 16.0.13127.20402
    Posts
    4

    Re: Help with complex (to me) XLOOKUP function to create interactive table

    Thanks for your reply! I agree that VBA would probably be better suited, but I don't know how to use VBA to solve this type of problem. Can you recommend a good learning resource that might have similar VBA exercises or problems to work through?

    Good catch on the 90# sled, but that was my mistake in naming the checkbox; all three skill levels use a sled, just with a different number of plates loaded. I know it's complex, but I'm trying to make every possible combo available to maximize what soldiers are able to choose from.

  4. #4
    Valued Forum Contributor
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    834

    Re: Help with complex (to me) XLOOKUP function to create interactive table

    I'm assuming you're on a MAC and are using Microsoft 365? If NOT, then the below will NOT work.

    I think this should give you what you are looking for. The formula below is dynamic in that once you type it into Cell A19 you can just copy it to the other cells below the days. (It assumes the Day is the cell above it. See attached.

    =FILTER(INDIRECT("Exercise_Table["&A18&"]"),(Exercise_Table[SkillLevel]=$C$4) * (ISNUMBER(SEARCH(Lists!$D$9,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$10,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$11,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$12,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$13,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$14,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$15,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$16,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$17,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$18,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$19,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$20,Exercise_Table[Equipment]))+ISNUMBER(SEARCH(Lists!$D$21,Exercise_Table[Equipment]))>COUNTBLANK(Lists!$D$9:$D$21)))

  5. #5
    Registered User
    Join Date
    09-28-2020
    Location
    Virginia Beach, VA
    MS-Off Ver
    Excel Version 16.0.13127.20402
    Posts
    4

    Re: Help with complex (to me) XLOOKUP function to create interactive table

    THAT WORKED!! (No, I'm not on a Mac, but it worked anyway!) Thank you SO MUCH!

  6. #6
    Valued Forum Contributor
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    834

    Re: Help with complex (to me) XLOOKUP function to create interactive table

    Great! (I assumed you were on a MAC based on the Excel version on your profile. On PC's it would be Version Microsoft 365, but MACs version would be 16.... So as long as you're on MS 365, it will work on MAC or PC)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can xlookup function be used in VBA?
    By jaryszek in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-22-2020, 02:20 AM
  2. Replies: 2
    Last Post: 03-22-2020, 09:05 PM
  3. Sum Function with Xlookup
    By sawaccouniting in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-07-2020, 10:10 PM
  4. Complex Search using OR/Index/Lookup ??? Trying to create new table as output
    By George Drivas in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-07-2018, 02:03 PM
  5. Replies: 0
    Last Post: 09-29-2014, 10:32 AM
  6. Function to interpolate a complex table
    By rustbucket11 in forum Excel General
    Replies: 4
    Last Post: 06-13-2012, 12:45 PM
  7. Embed complex interactive Excel in web page
    By inelsonom in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2011, 03:50 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts