+ Reply to Thread
Results 1 to 14 of 14

Creating a dynamic array to display multiple specific entries based on criteria

  1. #1
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Creating a dynamic array to display multiple specific entries based on criteria

    Hello,

    I'm trying to make an excel sheet where staff can enter customer details on one tab (name, dietary info, etc), and it will show up on another tab nicely formatted for printing.

    I want the formula to look at the customer's trip date. If it is tomorrow, enter their name in cell B19, the next customer with a trip tomorrow will get their name entered in cell B20. Continue until there are no more customers with trips tomorrow.

    Something is not working in my formula but I can't quite figure out what. I've attached a a basic sheet to show what I mean.

    Please let me know your thoughts.
    Attached Files Attached Files
    Last edited by Travisty; 09-07-2017 at 10:06 PM. Reason: Title was innapropriate

  2. #2
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Fixing an old formula

    Try this formula - I've made a few minor changes to make it work.

    It's an array formula so you'll need to do CTRL SHIFT ENTER to enter the formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Re: Fixing an old formula

    That seems to have done the trick! Thanks!

    I'll let you know if I need anything else

  4. #4
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Re: Fixing an old formula

    Hello again.

    I have another question. I'm trying to make the formula dependent on multiple criteria. For example, if a customer is signed up for tomorrow's lunch they they need to have their trip as tomorrow's date and they have to select "Lunch". Or if they are having dinner tomorrow they need to have tomorrows date and select "Dinner".

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I've attached another sheet so that you can see what I mean.

    Thanks for the help
    Attached Files Attached Files

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: Fixing an old formula

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Re: Creating a dynamic array to search for multiple specific entries based on criteria

    Apologies for the inappropriate thread title. It has been fixed now

    To reiterate the issue:

    I am trying to create a a dynamic array to display multiple specific entries based on criteria. The criteria, for example, could be that a customer is going on a trip tomorrow, and will be eating lunch. I want the customer's dietary restrictions to appear on tomorrow's lunch list. For example:

    On the 'CUSTOMERS' tab we can enter in column A the customers trip date. In Column G we enter their dietary restrictions, In Column K we enter if there will be present for lunch, dinner, both etc. On a separate tab - 'Trip Info' - I want their names and their dietary info to be displayed in columns B & C if the appropriate info has been entered on the 'CUSTOMERS' Tab

    Here is the formula I've been trying:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I've attached a sheet to help explain

    Thanks in advance
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Creating a dynamic array to display multiple specific entries based on criteria

    Thank You for changing the title.
    If I understand correctly then the following does what you want.
    The array entered formula* for 'Customer' is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The formula for 'Dietary', 'Medical' and 'Swim' is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Custom formatting has been added to hide the instances where the result is zero in the 'Dietary', 'Medical' and 'Swim' columns.
    *Array entered formulas are confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  8. #8
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Re: Creating a dynamic array to display multiple specific entries based on criteria

    Hello JetMc,

    Thanks for the solution. It's close to what I am looking for, but not quite there. The formula you wrote has a very limited rage (row 2 - Row 6), where as I am looking for a dynamic formula that can go to infinity (we don't know how many customers we will get). I actually managed to adapt it into something that almost works.

    I tried to post the fomula I made here but excelform keeps telling me "Access Denied - Sucuri Website Firewall -Your request was not authorized due to its content (HTML code not allowed)" I have formula tags around the formula, but it still won't let me post it properly. To get the forum to let me post, I had to put spaces in the middle of the formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This formula goes to infinity and works perfectly for my purposes. The only issue is that want to make it somewhat of a wildcard formula (See below)

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    (The above formula does not work, all I did was add an asterix)

    The reason I want to make it a wildcard formula is because I want customers to show up on the lunch list if CUSTOMERS!K:K says "Boat Lunch" or "Boat Lunch + Boat Dinner".

    I've attached an example, and in the example, a customer named "Lizzie" should show up on both the Lunch and the Dinner lists, but she doesn't show up on either. Also, with the wildcard formula, the last customer appears as "NUM".

    Is there a better way to go about making this formula?

    Thanks again.

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Creating a dynamic array to display multiple specific entries based on criteria

    I try to avoid using entire column references in array entered formulas as it puts my laptop into a hopeless tizzy.
    I would suggest either estimating the largest group, I used 100 in the attached formulas, or turning the range of data on the 'Customers' sheet (A2:K9) into an actual table and using structured formula references.
    Scurri kicked in because of the less than symbol immediately preceding ROWS, if you leave a space between, i.e. < ROWS Scurri ignores it.
    Here are the two modified formulas.
    For customer names*:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    For Dietary, Medical and Swim:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    *The formula for customer names needs to be entered as an array formula.
    Let us know if you have any questions.

  10. #10
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Re: Creating a dynamic array to display multiple specific entries based on criteria

    Hey JetMC,

    Thanks! That formula worked perfectly!

    I agree that entire column references are not the best because they slow things down a lot. The reason I use them is because if cells get deleted then the reference row can shrink. I solved that problem by editing the formula in the following way:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Thanks for the advice on scurri as well!

    I have one more questions. In my opinion this is the most difficult part of the sheet, I've been working on it for several hours but I don't even know how to approach the problem.

    Basically, in my country, in order to purchase harbor tickets for our customers we must present a specific form that lists the customers name, country, birth year, and if they are male of female. To simplify things the form is laid out as follows:

    Capture.PNG

    The formula for name name and country are easy. It is the one I have already been using. The formula for birth year /Gender is more difficult because the birth year should only show up if a specific gender is entered, and the cell should remain blank if the other gender is entered. I tried adapting one of your formulas:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    But it doesn't actually work. Even if the above formula did work, I would still be concerned that if 2 customers had the same name, the info would not show up properly as it would display the first customer's info twice.

    To further complicate the formula, Only customers who are going out in the morning (AM) should appear (there will be a separate "PM" Sheet). This means we have to enter "AM" into Column J on the Registry.

    Again, I've attached a sheet for better reference. You are looking at the AM Boat Reg tab.

    Any suggestions for how to fix this issue?

    Thanks,
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Creating a dynamic array to display multiple specific entries based on criteria

    This proposed solution adds a helper column, ID, to both the 'Registry' and 'AM Boat Reg' sheets. The helper columns may be hidden and/or moved for without affecting their usefulness.
    On the 'Registry' sheet the helper column is populated by the formula: =IF(B2="","",SUM(L1,1))
    On the 'AM Boat Reg' sheet the helper column is populated by your array entered formula redirected to index column L on the 'Registry' sheet.
    The array entered formula that populates columns C:D on the 'AM Boat Reg' sheet is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    You'll need to adjust the range of the formula to meet your needs.
    Let us know if you have any questions.

  12. #12
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Re: Creating a dynamic array to display multiple specific entries based on criteria

    Hey JetMC,

    That's a really smart solution and helps a lot! I've played with it a bit and there is one specific situation where it does not work. If we have two customers with the same name on different days, or (more likely) the same customer over 2 different days, their information will not show up on the second day because the formula on the AM Boat reg tab shows the ID for the first entry instead of the second entry.

    I've attached a sheet to show you what I mean. This sheet contains a very real entry that we put in almost every single day. If you go to the ÁM Boat Reg' tab you will see that the birth year doesn't appear.

    Please let me know your thoughts

  13. #13
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Re: Creating a dynamic array to display multiple specific entries based on criteria

    Actually, Ignore my last post. I don't know why it wasn't working, but is now.

    Thanks for this solution I'd give you rep but ti won't let me until I give some to someone else.

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Creating a dynamic array to display multiple specific entries based on criteria

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Fixing Formula NOW()
    By Jllerenp in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-28-2016, 11:25 AM
  2. [SOLVED] Help Fixing A Formula
    By artiststevens in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-21-2015, 03:12 AM
  3. [SOLVED] Need help in fixing my formula
    By rojashan in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-04-2014, 12:08 AM
  4. Fixing a Formula
    By Uvuriel03 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-21-2013, 08:43 AM
  5. Help Fixing IF/AND Formula
    By artiststevens in forum Excel General
    Replies: 22
    Last Post: 03-02-2012, 06:14 PM
  6. Fixing Part of a Formula
    By Daniel1234 in forum Excel General
    Replies: 2
    Last Post: 03-30-2010, 10:18 AM
  7. Fixing a formula
    By Boethius1 in forum Excel General
    Replies: 2
    Last Post: 01-18-2006, 07:38 PM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1