+ Reply to Thread
Results 1 to 14 of 14

"Dynamize the list of names"

  1. #1
    Forum Contributor
    Join Date
    05-27-2021
    Location
    italy
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    109

    "Dynamize the list of names"

    Hello, good morning. I wanted to know if it was possible to make the list of names dynamic in Excel using dynamic formulas for recalculating the range that automatically adapts to the addition or removal of new rows between the various headers. Since there are multiple headers in the list, I wanted to know if it was possible to dynamically recalculate the range between two headers.

    For example:
    a1=carbohydrates 'header

    a2:a100 contains the list of carbohydrate names

    a101=proteins header

    a101:a200 contains the list of protein names

    In the case of adding or removing a row in one of the two lists, can the calculation be made dynamic so that it calculates everything that is added or removed between the two headers?

    Let me give you an example: if a row is removed from the carbohydrate list, the range will become A2:A99, so the second header will be in row 100. The same applies if a row is added. Therefore, the formula should search for the headers and then define the range between the two headers.

    Please create the formulas for Excel in Italian.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: "Dynamize the list of names"

    Please upload a small sample sheet that we can play with. Excel will (mercifully) translate the formula for you when you open it at your end with OUR formulae in it.

    It will also translate the formulae into English for us, so we can see what you want to do.

    The yellow banner (top) gives guidelines for sample sheets.

    are you still using Excel 2007? if not, pelase amend your profile appropriately.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    05-27-2021
    Location
    italy
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    109

    Re: "Dynamize the list of names"

    "Thank you for the suggestion, I followed your instructions."
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: "Dynamize the list of names"

    1. Put a suitable "ending word" at the bottom of the list. I used "End".

    2. Complie a list of categories (they're in D1:D4... including END).

    3. I am not ENTIRELY sure what you want, but take a look at the formulae in E1, F1 and G1. Is this what you wanted?
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    05-27-2021
    Location
    italy
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    109

    Re: "Dynamize the list of names"

    Hello Glenn Kennedy,

    Let me explain my idea. I have two Excel sheets, one used as a data collection called "DATABASE" which contains the sheet "DATABASE ALIMENTI," and the other is "Macronutrition calculator PRO1," which contains the sheet with the links from the "DATABASE ALIMENTI" sheet.

    The reason for my request to make these formulas and name lists dynamic is as follows:

    Currently, the lists and formulas are static. So, if I wanted to add data, I would have to manually modify the lists and update the formulas. However, if I can make them dynamic, it will avoid adjusting these values every time.

    Within the Macronutrition calculator PRO1 file, you will find a pivot table called "NUOVI ALIMENTI." Here, through a macro in the Macronutrition calculator PRO1 file, I add the NEW FOODS to the DATABASE file.

    Once the formulas and name lists are made dynamic, I could sort the database by the respective headers. Here are the headers and name lists:

    FONTI_PROTEICHE ='DATABASE ALIMENTI"! $A$984:$A$1490
    FONTI_GLUCIDICHE ='DATABASE ALIMENTI"! $A$3:$A$982
    ALCOOL ='DATABASE ALIMENTI'!$A$2326:$A$2338
    PRODOTTI VARI ='DATABASE ALIMENTI'!$A$2295:$A$2324
    DOLCI ='DATABASE ALIMENTI'!$A$2249:$A$2293
    UOVA ='DATABASE ALIMENTI'!$A$2241:$A$2247
    FORMAGGI ='DATABASE ALIMENTI'!$A$2198:$A$2239
    LATTE_E_YOGURT ='DATABASE ALIMENTI'!$A$2174:$A$2196
    PESCE ='DATABASE ALIMENTI'!$A$2091:$A$2172
    FRATTAGLIE ='DATABASE ALIMENTI'!$A$2074:$A$2089
    CARNI_TRASFORMATE_SALUMI ='DATABASE ALIMENTI'!$A$2023:$A$2072
    FRUTTA ='DATABASE ALIMENTI'!$A$1929:$A$2021
    VERDURA_E_ORTAGGI ='DATABASE ALIMENTI'!$A$1827:$A$1927
    LEGUMI ='DATABASE ALIMENTI'!$A$1795:$A$1825
    FONTI_LIPIDICHE ='DATABASE ALIMENTI'!$A$1492:$A$1793
    I will carry out the sorting of the database using the macro present in the Macronutrition calculator PRO1, which I mentioned, which will be activated every time data is entered into the DATABASE file in the DATABASE ALIMENTI sheet.

    I still have to create this part of the macro, but the idea is to take the value from the row present in NUOVI ALIMENTI and move it to the header it refers to, which will be determined through this formula:

    =SE(E(E2339>F2339;E2339>G2339);"FONTI GLUCIDICHE";SE(E(F2339>E2339;F2339>G2339);"FONTI PROTEICHE";SE(E(G2339>E2339;G2339>F2339);"FONTI LIPIDICHE";"")))
    I hope I have been clear with my request. If you have any doubts or further requests, please feel free to ask.
    Attached Images Attached Images
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: "Dynamize the list of names"

    I think we are close... but not quite understanding each other.

    I am confused by the new files, as the Named Range for Fonti Gluciiche refers to ='DATABASE ALIMENTI'!$A$879:$A$981... but on database Aliment it starts at row 2.

    the formula I gave you for Glucidi was:

    =INDEX($A:$A,MATCH($D$1,$A:$A,0)+1):INDEX($A:$A,MATCH($D$2,$A:$A,0)-1)

    This dynamically selects all rows 1 BELOW the header (selected by the red cell) all the way down to the one ABOVE the next header (blue). If you use that as the Named Range... instead of your Fixed range version (cyan) that's the job done.


    If you don't want to pick up the Glucidi from a cell... then hard code it into the formula:

    =INDEX($A:$A,MATCH("Glucidi",$A:$A,0)+1):INDEX($A:$A,MATCH("Protidi",$A:$A,0)-1).

    In the reattached file all 3 versions are there.

    1. Names picked up from cell reference.
    2. Hard coded intot he formula.
    3. named Range (based on option 2).

    Now insert a row or two into the glucidis and ALL 3 of the columns update dynamically.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-27-2021
    Location
    italy
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    109

    Re: "Dynamize the list of names"

    The file you provided earliI apologize for the confusion earlier. The file I provided earlier was indeed a file to understand if dynamic ranges could be obtained. Upon analyzing my original files, the ones I have provided to you, I will need multiple formulas to properly manage the data.

    I will need a dynamic formula to handle the data in the list of names and a formula to manage the links in the Macronutrition calculator PRO1 file, specifically in the DATABASE ALIMENTI sheet.

    Additionally, the reference "END" used by you should be removed and made to coincide with the header of the "NUOVI ALIMENTI" table. Furthermore, the list should not be extracted but rather modifiable within column A.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: "Dynamize the list of names"

    I will need multiple formulas to properly manage the data.
    That is correct. you will need one for each category.

    I will need a dynamic formula to handle...
    Yes. You can do that. I have shown you HOW to do it. I will give you guidelines on what to do, but this is a >>free<< HELP forum. We help guide you to a solution. Where repetitive tasks are required we all expect YOU to do that bit.

    Additionally, the reference "END" used by you should be removed and made to coincide with the header of the "NUOVI ALIMENTI" table. Furthermore, the list should not be extracted but rather modifiable within column A.
    I do not understand what you mean but I am happy to guide you further.

  9. #9
    Forum Contributor
    Join Date
    05-27-2021
    Location
    italy
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    109

    Re: "Dynamize the list of names"

    Thank you for your response.

    To clarify, I understand that I will need separate formulas for each category. I will work on creating these formulas based on the guidelines provided.

    Regarding the dynamic formula to handle the data, I appreciate the guidance you've provided so far, and I will follow your instructions to implement it. I understand that this forum provides assistance and guidance, and I am prepared to do the necessary work to implement the solutions provided.

    Regarding the reference "END" and the modifiability of the list within column A, let me explain further. The "END" reference was a misunderstanding on my part, and I acknowledge that it should be replaced with the header of the "NUOVI ALIMENTI" table. Additionally, when I mentioned modifiability within column A, I meant that the list of names should be editable directly within column A rather than being extracted or referenced from elsewhere.

    I appreciate your willingness to guide me further, and I am ready to proceed with implementing the necessary changes based on your instructions.

    How should this formula be modified to make it dynamic, as found in the Macronutrition calculator PRO1 file containing the links to the database?
    =SE('C:\Users\Utente\Desktop\Macronutrition Calculator\DATABASE\[DATABASE.xlsm]DATABASE ALIMENTI'!A1971<>"";'C:\Users\Utente\Desktop\Macronutrition Calculator\DATABASE\[DATABASE.xlsm]DATABASE ALIMENTI'!A1971;"")
    Last edited by GrabberHackman; 03-27-2024 at 05:20 PM.

  10. #10
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: "Dynamize the list of names"

    To help us to come up with a better solution, maybe you should tell us what you are trying to achieve. Are you creating formulas linking to the lists? If so, please show us what your actual workbook looks like.

  11. #11
    Forum Contributor
    Join Date
    05-27-2021
    Location
    italy
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    109

    Re: "Dynamize the list of names"

    Here are my original files. https://www.excelforum.com/excel-for...ml#post5934939

    Yes, I need to dynamically manage both the lists of names and the links to the database file.

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: "Dynamize the list of names"

    You said "How should this formula be modified to make it dynamic, as found in the Macronutrition calculator PRO1 file containing the links to the database?"

    I'm not really sure what you mean by that. If you copy it down for a 100 rows after the end of the data... it will automatically update and add on up to 100 new items as they are added to your list.

  13. #13
    Forum Contributor
    Join Date
    05-27-2021
    Location
    italy
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    109

    Re: "Dynamize the list of names"

    The issue with the "Macronutrition calculator PRO1" sheet containing links to the "DATABASE ALIMENTI" sheet is as follows:
    If I add or delete a row from the "DATABASE ALIMENTI" sheet in the "DATABASE" file,
    these changes are not updated with the following formula in the "Macronutrition calculator PRO1" sheet.

    =SE('C:\Users\Utente\Desktop\Macronutrition Calculator\DATABASE\[DATABASE.xlsm]DATABASE ALIMENTI'!A2<>"";'C:\Users\Utente\Desktop\Macronutrition Calculator\DATABASE\[DATABASE.xlsm]DATABASE ALIMENTI'!A2;"")

    I used your formula to create data validation directly in the "DATABASE" file on the "DATABASE ALIMENTI" sheet, but if the sheet is closed, these formulas do not work.
    =INDICE('C:\Users\utente\Desktop\Macronutrition Calculator\DATABASE\[DATABASE.xlsm]DATABASE ALIMENTI'!$A:$A;CONFRONTA("FONTI GLUCIDICHE";'C:\Users\utente\Desktop\Macronutrition Calculator\DATABASE\[DATABASE.xlsm]DATABASE ALIMENTI'!$A:$A;0)+1):INDICE('C:\Users\utente\Desktop\Macronutrition Calculator\DATABASE\[DATABASE.xlsm]DATABASE ALIMENTI'!$A:$A;CONFRONTA("FONTI PROTEICHE";'C:\Users\utente\Desktop\Macronutrition Calculator\DATABASE\[DATABASE.xlsm]DATABASE ALIMENTI'!$A:$A;0)-1)

  14. #14
    Forum Contributor
    Join Date
    05-27-2021
    Location
    italy
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    109

    Re: "Dynamize the list of names"

    In the file, I have added some formulas to retrieve the data, but the issue with the links to the database file still remains.
    Attached Files Attached Files

+ 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. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  2. replace all defined range names in the sheet that start with "Street" to "Road"
    By matrex in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-04-2016, 08:53 AM
  3. Replies: 1
    Last Post: 02-20-2015, 01:13 PM
  4. How to "Search and replace" a list of different names - multiple times
    By The Excel Noob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2015, 06:10 AM
  5. Find Names from a List of Names and Replace with "The Candidate"
    By viggykuppu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2014, 02:49 AM
  6. [SOLVED] Reverse personal names from "First Last" to "Last, First" and accommodate middle names
    By MrGadget6977 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-17-2013, 07:10 PM
  7. Excel Function that differentiates "male" from "female" names with 900+ names
    By doylehargrove in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-17-2012, 06:00 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