+ Reply to Thread
Results 1 to 16 of 16

Generate two columns based on a branching map of values

  1. #1
    Registered User
    Join Date
    08-27-2020
    Location
    Bakersfield, CA
    MS-Off Ver
    Office 365
    Posts
    26

    Generate two columns based on a branching map of values

    Starting with a flowchart:
    Animals Flow.png

    I've entered data into excel like so as a starting point:
    Animals Excel.png

    I'm using the "|" and "backslash" (it won't let me enter the actual character) symbols both as a visual aid for humans, and I'm also thinking I can search for those characters algorithmically. I don't NEED those characters, I'm just thinking it will be easier to do what I'm trying to do if they're there. What I'm trying to do is take this map, or any arbitrary map of any complexity, and generate a pair of columns of the relationship between the items. In this example, the list of relationships would be this:

    animals relationship.png

    I've been poking at this with a bunch of IFs and the various LOOKUP functions, but I feel like I'm getting nowhere, so I thought I'd see if the forum had any better ideas, because you usually do.

  2. #2
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,868

    Re: Generate two columns based on a branching map of values

    Please, upload a sample excel file with expected results.

  3. #3
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,168

    Re: Generate two columns based on a branching map of values

    So you would manually enter what you're showing in rows 1 -14, and expect the results what you're showing in rows 16-36?

    What about going the other way - entering your data in rows 16-36 and generating rows 1-14?

    As windknife said, please attach a sample file that we can work with.

  4. #4
    Registered User
    Join Date
    08-27-2020
    Location
    Bakersfield, CA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Generate two columns based on a branching map of values

    I've made some progress. I've been able to (mostly) generate the second column. I highlighted the successful part in green. Columns Worksheet.xlsx

    I used this formula:

    =LET(range,K1:S14,FILTER(TOCOL(range,0),TOCOL(range,0)<>""))

    Still working on the first column though, and revision to the second column...

  5. #5
    Registered User
    Join Date
    08-27-2020
    Location
    Bakersfield, CA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Generate two columns based on a branching map of values

    Quote Originally Posted by Gregb11 View Post
    What about going the other way - entering your data in rows 16-36 and generating rows 1-14?
    Going the other way doesn't work in the workflow this will be used for. The user is building the map. That is, the map doesn't exist yet, and they are adding entries. The formula is meant to collect the relationships the user has created so they have a list of relationships that need further processing with formulae I haven't gotten to yet.

  6. #6
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,868

    Re: Generate two columns based on a branching map of values

    How about this?
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by windknife; 12-26-2024 at 03:54 AM.

  7. #7
    Registered User
    Join Date
    08-27-2020
    Location
    Bakersfield, CA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Generate two columns based on a branching map of values

    Quote Originally Posted by windknife View Post
    How about this?
    I should have grown to expect this by now, but every time I see it, I'm still amazed. I don't know if this works yet. Mostly because I don't understand what you did, and it will take me time to analyze and test it. But you definitely approached this from a direction I didn't see coming. I thought I was being clever by using the LET and TCOL functions. I don't even know what most of the functions you used are. As I said, I'll have to analyze and test. But...wow.

    Thank you. I'll reply again when I have feedback.

  8. #8
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,868

    Re: Generate two columns based on a branching map of values

    You are welcome.
    -----------------------------------
    If that takes care of your original question, please click on "Thread Tools" from the menu link above and mark this thread as SOLVED.

  9. #9
    Registered User
    Join Date
    08-27-2020
    Location
    Bakersfield, CA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Generate two columns based on a branching map of values

    Quote Originally Posted by windknife View Post
    You are welcome.
    -----------------------------------
    If that takes care of your original question, please click on "Thread Tools" from the menu link above and mark this thread as SOLVED.
    Still working on it. This is going to take some time...

  10. #10
    Registered User
    Join Date
    08-27-2020
    Location
    Bakersfield, CA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Generate two columns based on a branching map of values

    For archival reasons, I'm posting supplemental info here. The formula above had a weakness. It required the entire array it was looking at to be filled with data. I started another thread to seek a solution to the problem here. This resulted in a modification to the formula above as follows:
    Please Login or Register  to view this content.
    Still working on the "bigger picture" of this code.

  11. #11
    Registered User
    Join Date
    08-27-2020
    Location
    Bakersfield, CA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Generate two columns based on a branching map of values

    I've run into a snag.

    If rows are added above, the formula no longer works. I know this code is looking at odd and even rows, so I made sure the data was on even rows, but still, it stops functioning. This behavior also arises if the entire data entry area and formula are duplicated. I'm attaching the spreadsheet with a working implementation at the top, and a non working implementation if you scroll down.

    Columns Worksheet 3.xlsx

  12. #12
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,868

    Re: Generate two columns based on a branching map of values

    amended formula,
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    08-27-2020
    Location
    Bakersfield, CA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Generate two columns based on a branching map of values

    That works. Thank you, and thank you for doing it so quickly. But I understand the formula even less now, lol.

  14. #14
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,868

    Re: Generate two columns based on a branching map of values

    You can use the following methods to see the results of each step.
    a
    Please Login or Register  to view this content.
    b
    Please Login or Register  to view this content.
    c
    Please Login or Register  to view this content.
    d
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    08-19-2024
    Location
    Philippines
    MS-Off Ver
    MS365 for Business
    Posts
    96

    Re: Generate two columns based on a branching map of values

    The following is a variation of @windknife's solution, using the same basic logic with different methods:
    Please Login or Register  to view this content.
    Or possibly simplified even further:
    Please Login or Register  to view this content.
    Cheers!
    Attached Files Attached Files
    Last edited by djclements; 12-29-2024 at 02:46 PM. Reason: Added alternative formula

  16. #16
    Registered User
    Join Date
    08-27-2020
    Location
    Bakersfield, CA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Generate two columns based on a branching map of values

    I'm being pulled onto a different job by my task masters, so my work on this will have to pause for a time. I'm going to mark this thread as solved, but may come back with some comments about the new formulae by windknife and djclements.

+ 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] How to generate a list of columns F and G based on columns A and B in OFFICE365
    By choletseng in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-12-2022, 10:00 AM
  2. Generate charts based on filled columns
    By declan1983 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-05-2020, 10:07 AM
  3. [SOLVED] Generate unique ID based on criteria from different columns
    By cherias in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-28-2019, 11:34 PM
  4. Generate Random Numbers when values detected under other columns
    By Abbat in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-04-2019, 02:44 PM
  5. Generate a SKU based on columns of data
    By dgriffis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-13-2017, 10:01 PM
  6. [SOLVED] How to generate a list based on values from several columns
    By KForsman in forum Excel General
    Replies: 8
    Last Post: 06-17-2014, 12:10 PM
  7. [SOLVED] How to generate values based on various conditional values
    By djh30 in forum Excel General
    Replies: 1
    Last Post: 07-03-2013, 01:31 PM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1