+ Reply to Thread
Results 1 to 21 of 21

Populating A Matrix from results sheet

  1. #1
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Populating A Matrix from results sheet

    Hi Guys,

    I have a program here I am trying to build and need some help.

    What I am am trying to do is from the Data sheet from 1st Record find if TYPE F exists on Results sheet and if not find 1st blank row
    in the column range allowed and paste TYPE F data, then with TYPE C find if it exists in Range TYPE C if not then paste data.

    Next find if TYPE CA exists in the range TYPE CA if not input data in lowest cell range. Then same for TYPE D.


    For example for 1st record retrieved from data sheet '13. Result M' and doesn't exist so add to TYPE A range, next DESC A doesn't exist add and only one occurrence of 13. Result M so a 1 added to intersect range.

    Next '15. F Cause O' doesn't exist add to TYPE CA range and with intersect range add the number value in front of TYPE F data in this case 15
    Next add F Measure D and add 1 for 1st occurrence

    sounds complicated but if you look at the workbook it is not.

    I have tried a few ideas but not getting anywhere. Your help is much appreciated.

    Thanks
    Lionel
    Attached Files Attached Files
    Last edited by Foreverlearning; 03-30-2012 at 04:42 PM.

  2. #2
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Nobody likes my problems or am I too difficult to understand (I will explain more if needed)

    Thanks
    Lionel

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Populating A Matrix from results sheet

    hi Lionel, usually that means that the task in not clear, can you answer a couple of questions:

    1. What could be the maximum number of rows of initial data? Is the matrix size is maximum it can take or it should be extended to accomodate more data?
    2. The left lowest matrix segment is empty, is it ok or you missed to write explanation for it?
    3. Can you explain this:
    What I am am trying to do is from the Data sheet from 1st Record find if TYPE F exists on Results sheet and if not find 1st blank row
    in the column range allowed and paste TYPE F data, then with TYPE C find if it exists in Range TYPE C if not then paste data.
    4. Would the matrix be filled from the scratch each time or data might be added to existing matrix filled data?
    Last edited by watersev; 03-19-2012 at 04:07 AM.

  4. #4
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Hi Watersev,

    Thanks for responding..


    1. The data is dynamic - meaning it is added too when needed - so as the program is developed it will reach a stage when the maxtrix is full that the user will
    have to set a date range to populate.

    1a The matrix is limited to 15 cell range either way. (I hope I counted correctly)

    2. The lower left has no value recorded.

    3. From the data sheet we have the 1st record and in column c we have "13. Result M" so on the Matrix under Section of rows marked TYPE F
    we need to find if this value already exists if it does we move on to next step if not we find 1st blank cell in that range and input "13. Result M"
    next column D from record is "DESC A" so on matrix we look in range marked TYPE C which is a range of columns and see if this value exist in this range
    if not find 1st blank cell and input.

    Now with these 2 values inputed we find the intersect cell and enter value 1 - if a value already exists we add 1 to that value 1+1 =2
    Next from record is column F which is "15. F Cause O" and we look in Matrix range TYPE CA and 1st cell is lower end of range going up we see if value exists
    here and if not find 1st blank cell going upwards and input "15. F Cause O"

    Now we find intersect cell of TYPE C last entered above with TYPE CA value just entered and here we add the number value from TYPE F from that record.
    If a value exists here we add a coma and input value beside not add too.

    Now next column G from record with this value we find the 1st empty cell in TYPE D range on matrix which the range goes from right to left and input here, if value exist we
    move to next step and with intersect of these values from TYPE CA and TYPE D we add one to cell if value already here we add to value 1+1 =2

    The cycle on matrix is anti clockwise on entering data.

    I hope I haven't lost you.

    4. The matrix I believe should be populated on viewing matrix either sheet activate or macro button to view sheet.
    that means a clean start every time it is viewed.

    As for the range being filled to being full I would like the code to halt and ask the user to select a date range and the user to restrict range if full.

    Thanks
    Lionel

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Populating A Matrix from results sheet

    please check attachment, option to make it, run code "test"
    Attached Files Attached Files
    Last edited by watersev; 03-20-2012 at 01:10 AM.

  6. #6
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Hi Watersev,

    Mate, that is just wonderful.

    I am going to give it a going through to understand what is happening and get back to you.

    I really appreciate your help. (Some really good blokes on this forum)

    Regards
    Lionel

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Populating A Matrix from results sheet

    hi Lionel, please check corrected attachment:

    1. Corrected error on filling data for Type D
    2. Somehow Type CA number of rows was 16, one row deleted, code amended
    3. I've added error message if the data does not fit the matrix size indicating the starting excessive row and its data
    Attached Files Attached Files
    Last edited by watersev; 03-20-2012 at 04:46 AM.

  8. #8
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Hi watersev,

    Thank you for responding.

    After giving the code a run I find that if in column C (TYPE F) we used the last same letter on a different number the code will ignore that data.

    The determining factor of column c (TYPE F) is the number preceding the data. But the data is always the same for a particular number.
    The same is for any column that has a number preceding it.

    The following applies
    Column C (TYPE F) a number followed by data but always same data after the same number.
    Column D (TYPE C) the description of a part, is a range of data but can be used more than once. eg. Bearing, Guide, Bolt, Bearing, etc

    Column F (TYPE CA) same criteria applies as in Column C
    Column G (TYPE D) same criteria as in column D

    The data used was dummy data to give an example.

    Sorry if I mislead you.

  9. #9
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Populating A Matrix from results sheet

    please check attachment

    Type F: duplicate entry is checked by number
    Type CA: duplicate entry is checked by number
    Attached Files Attached Files
    Last edited by watersev; 03-21-2012 at 10:52 AM.

  10. #10
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Thank You watersev

    This is looking very good mate.

    Can I ask you to add a date range function to allow the Matrix to populate from between start date and end date.

    This would allow full access to data if it holds quite a few records.

    I am looking at autofit columns for Column S to AG.

    I really do appreciate you guys sharing your knowledge and it is helping me learn from a different angle.

    Thanks
    Lionel

  11. #11
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Populating A Matrix from results sheet

    please check attachment, run code "Fill_Matrix"

    Notes:

    1. Date format for date input is the same as in your local settings
    2. If for example Start date ="" and End date = 01.01.2012 or vice versa, the code would fill matrix with 01.01.2012 date only
    3. If you need to process all dates on the sheet, you need to enter date range that fully covers dates on the worksheet, for example Start date = 01.01.1900 and End date 01.01.2100
    4. If both dates are empty (no input) the code quits
    5. Column S:AG widths are autofited after pasting result on the matrix sheet
    Attached Files Attached Files
    Last edited by watersev; 03-22-2012 at 07:02 AM.

  12. #12
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Hi watersev,

    You have helped me greatly mate.

    Last part of my assignment is populating some more data.
    Please check attached for further explanation.

    My learning curve has gone thru the roof in the last week or so.

    Thanks
    Lionel
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Populating A Matrix from results sheet

    please check attachment

    Notes:

    1. I've experimented with the code and found a bug with TypeD, it was corrected
    2. 4M column will have only 4 unique values as in example
    3. Cause column will have only 5 unique values as in example
    Attached Files Attached Files
    Last edited by watersev; 03-24-2012 at 03:22 PM.

  14. #14
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Thank you for latest update.

    I encountered error on 1st run, just had to declare Causechk as string

    Could I ask that the CAUSE A TO E be fixed if no value, in order (That is Column AI to AM on results sheet)

    Regards
    Lionel

  15. #15
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Populating A Matrix from results sheet

    please check attachment
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Thank You kindly.

    I will give it a whirl

    Regards
    Lionel

  17. #17
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Hi watersev.

    Very happy with your efforts mate.

    Everything is looking good.

    I will let you know how it goes.

    Regards
    Lionel

  18. #18
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Hi watersev,

    Went well after adapting to original data.

    Is it possible to list only the data that fits onto matrix and indicate last record used to fit onto matrix.

    Regards
    Lionel

  19. #19
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Populating A Matrix from results sheet

    hi Lionel,please check attachment

    Notes:

    1. The code will check if data fits before filling each row after 15. If one of the four types does not fit, the whole row will not be added to matrix.
    2. If data does not fit you will get a message box showing the last record number that was successfully added to the matrix
    Attached Files Attached Files
    Last edited by watersev; 03-28-2012 at 02:33 AM. Reason: Code updated to reflect record number not the row #

  20. #20
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Thank you once again.

    Will check with original data and post back.

    Lionel

  21. #21
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    178

    Re: Populating A Matrix from results sheet

    Sorry for posting back late.

    Everything works perfectly.

    Thank you for your time and effort.

    Lionel

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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