+ Reply to Thread
Results 1 to 16 of 16

Gather information from a Mastersheet to individual worksheets - pending selection

  1. #1
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57

    Gather information from a Mastersheet to individual worksheets - pending selection

    I cant figure out how to do this.

    I have a Master list of kids names and age groups, that will be used by Coaches to update, from this i would like to have each of the different age groups details extracted into different worksheets within the same workbook.

    I used an IF statement to but found it was leaving blank lines between finds.

    I have attached the spreadsheet - any help or hints or alternative methods are welcomed.

    Peter
    Attached Files Attached Files
    Last edited by toeragh; 08-12-2008 at 08:36 AM. Reason: update title description

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Hi,

    Can you please read our forum rules.. then amend your title to something more descriptive of the issue at hand?

    Thanks.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57
    tidied up the spreadsheet a little bit. problem still exists.
    Attached Files Attached Files

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try this formula in B6:

    Please Login or Register  to view this content.
    Which must be confirmed with CTRL+SHIFT+ENTER not just ENTER. You will see { } brackets appear around the formula.

    Then copy down and across your chart.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57
    OK ... you have me there. can you explain what this is doing, I can't follow it

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    The first part of the formula: IF(ROWS($A$1:$A1)>SUMPRODUCT(('MASTER LIST'!$H$7:$H$38="P2")+('MASTER LIST'!$H$7:$H$38="P3")) checks to see if the row number you're in is greater than the number of "P2" or "P3" entries...if it is greater then a blank is inserted (it's an error trap).

    The next part: INDEX('MASTER LIST'!B$7:B$38,SMALL(IF(('MASTER LIST'!$H$7:$H$38="P2")+('MASTER LIST'!$H$7:$H$38="P3"),ROW('MASTER LIST'!$H$7:$H$38)-ROW('MASTER LIST'!$H$7)+1),ROWS($A$1:$A1)))

    is like a vlookup for multiple matches... It uses the Index() function which requires you to index the table or column to extract from and it requires the Row number to extract from which is gotten from this part: SMALL(IF(('MASTER LIST'!$H$7:$H$38="P2")+('MASTER LIST'!$H$7:$H$38="P3"),ROW('MASTER LIST'!$H$7:$H$38)-ROW('MASTER LIST'!$H$7)+1)

    The Small() function just allows us to step up and extract one match at a time, starting from the first match found. It will extract only if a "P2" or "P3" is found in range MASTER LIST'!$H$7:$H$38 and then it will return the corresponding row number within the range. The -ROW('MASTER LIST'!$H$7)+1 is added for robustness (in case you insert rows above, then the result won't skew).

    The last ROWS($A$1:$A1) is the k factor for the Small() function, which is like a step factor in a For...next loop in VBA.

    The CSE confirmation is because it is an array formula and you have to confirm with those keys to make these formulas work.

    Then you copy down... The only thing that changes copying down is the ROWS($A$1:$A1) in the 2 occurances within the formula.. again to determine the step or row number we're in.

    The only thing that changes when going across the table is what is Indexed (i.e. INDEX('MASTER LIST'!B$7:B$38..) and the specific item to use as a criteria (i.e. "P2" or "P3").

    Hope this clarifies a bit.

  7. #7
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57
    OK. I will need to print this and read it over a couple of times to get in my head. For the other ages groups they will be single groups IE P4 or P5 or P6
    P2 & P3 is the only joint one. So with that in mind ... when doing the line SMALL(IF(('MASTER LIST'!$H$7:$H$38="P2")+('MASTER LIST'!$H$7:$H$38="P3"),ROW('MASTER LIST'!$H$7:$H$38)-ROW('MASTER LIST'!$H$7)+1)

    I will use SMALL(IF(('MASTER LIST'!$H$7:$H$38="P4"),ROW('MASTER LIST'!$H$7:$H$38)-ROW('MASTER LIST'!$H$7)+1)

    Well here goes ... I maybe sometime getting my head round this - so will answer tomorrow.

    Thanks. greatly appreciated.

    Peter.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by toeragh
    OK. I will need to print this and read it over a couple of times to get in my head. For the other ages groups they will be single groups IE P4 or P5 or P6
    P2 & P3 is the only joint one. So with that in mind ... when doing the line SMALL(IF(('MASTER LIST'!$H$7:$H$38="P2")+('MASTER LIST'!$H$7:$H$38="P3"),ROW('MASTER LIST'!$H$7:$H$38)-ROW('MASTER LIST'!$H$7)+1)

    I will use SMALL(IF(('MASTER LIST'!$H$7:$H$38="P4"),ROW('MASTER LIST'!$H$7:$H$38)-ROW('MASTER LIST'!$H$7)+1)

    Well here goes ... I maybe sometime getting my head round this - so will answer tomorrow.

    Thanks. greatly appreciated.

    Peter.

    You should also then replace this SUMPRODUCT(('MASTER LIST'!$H$7:$H$38="P2")+('MASTER LIST'!$H$7:$H$38="P3") with COUNTIF('MASTER LIST'!$H$7:$H$38,"P4") in the error trap part of the formula.

  9. #9
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57
    OK, what have I done wrong - its not working for me.

    =IF(ROWS($A$1:$A1)>COUNTIF('MASTER LIST'!$H$7:$H$38,"P4"),INDEX('MASTER LIST'!B$7:B$38,SMALL(IF(('MASTER LIST'!$H$7:$H$38="P4"),ROW('MASTER LIST'!$H$7:$H$38)-ROW('MASTER LIST'!$H$7)+1),ROWS($A$1:$A1))))

    The result I get is "FALSE"

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You forgot to but a null for "value if true" part of the first IF() statement....

    I.e.

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57
    I've copied up the sheet - there is obviously something not right with my excel (using Office 2007), as your last suggestion still does not work.

    Please do not think that I am taking the rip here, I am honestly trying to get it to work. Using the formula evaluator, i can step through your formula and see what it going on. This has helped along with your description on how it works.

    I have to make a copy of it and strip out the working worksheet, as its size is getting to large to post up here.

    The other attachment shows what happens using the formula evaluator

    Peter.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by toeragh; 08-13-2008 at 09:43 AM.

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I think this time you forgot to confirm the formula with CSE keys.. as I did not see the { } brackets...

    see attached.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57
    how do I use the CSE keys - never done it before.
    If i edit one of your forumalaes the CSE brackets vanish and then it does not work again.

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Every time you edit a CSE formula (an array formula) you have to hold down the CTRL and SHIFT keys together and press ENTER. This makes the special brackets appear and therefore makes Excel understand that you have an array formula.

    You can then copy the formula down and across as normal...the array aspect will copy too.

    Have a look here for more info on Array formulas: http://www.cpearson.com/excel/ArrayFormulas.aspx

  15. #15
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57

    Thumbs up

    SORTED.

    Thank you thank you thank you.

    You learn something new every day - and over the last 2 days I have had a lesson.

    Fantastic. What more can I say. You have made an old man very happy.

  16. #16
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Great! Glad it all worked out.

    Thanks for the feedback.

+ 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