+ Reply to Thread
Results 1 to 20 of 20

Extracting certain data depending on criteria

  1. #1
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Extracting certain data depending on criteria

    Hope there is an easy solution to this.... lol

    Have a perfect working spreadsheet, but now need to extract certain bits of data depending on one criteria.

    Each row contains data in different columns.

    What i need to do is depending on the criteria of a cell (i.e. whether its Y or N) i would like to extract certain cells onto another worksheet all within the smae work book

    i.e for example
    If i have columns A,B,C,D,E and F and then x amount of rows (as these can change as data is entered) if a Y is entered in F then it extracts the data out of columns A, C and D

    Last edited by drgogo; 09-15-2009 at 10:46 AM.

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

    Re: Extracting certain data depending on criteria

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    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
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: Extracting certain data depending on criteria

    Sorry, Should of attached an example, which i have now done

    The first sheet in the example the normal sheet where all the data goes, as you will notice that two entrys are highlighted, you will see over to the right handside that there is a Y in the column marked DDA and then comments

    On the second sheet, the new sheet within the workbook, you will see the data that has been extracted, the two entries are the ones from the first sheet marked as Y under the DDA column.

    The example is a dummy, but hope fully you will see what im trying to do

    Gareth
    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

    Re: Extracting certain data depending on criteria

    In Timetable Service sheet, cell R2, enter formula:

    =IF(O2="Y",MAX(R$1:$R1)+1,0)

    and copy down as far as you want...

    Then in DDA sheet, cell G1, enter formula:

    =MAX('Timetabled Service'!R:R)

    Then in A3, enter formula:

    =IF(ROWS($A$1:$A1)>$G$1,"",INDEX('Timetabled Service'!D:D,MATCH(ROWS($A$1:$A1),'Timetabled Service'!$R:$R,0)))

    and copy down as far as you want....

    Formula can be copied across too, but you will need to adjust the range right after the INDEX() to match the column you want to extract...

  5. #5
    Registered User
    Join Date
    09-09-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Extracting certain data depending on criteria

    This is almost what I am looking for, but I need to go a step further. I need to create a similar roll up summary sheet with results from multiple worksheets.
    Attached Files Attached Files

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

    Re: Extracting certain data depending on criteria

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.

  7. #7
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: Extracting certain data depending on criteria

    Thanks for the solution, its working after a bit of fiddling, hopw would i change the formula if i what to extract data from lets say two work sheets with the same work book ?

    Also in the cells where there is not data it shows #n/a, is there any way of removing this ?

    Is it normal when using this type of formula for the sheets to slow down and recalculate?



    G

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

    Re: Extracting certain data depending on criteria

    Please post a new sample workbook showing your requirements...

  9. #9
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: Extracting certain data depending on criteria

    Sorry, thought it may of been easy..

    Have post another example workbook, its the same as the lastone but witht he second page added, as you will see the second page is of a disfferent format

    Hope this help

    And thank your for all your help

    G
    Attached Files Attached Files
    Last edited by drgogo; 09-10-2009 at 08:51 AM. Reason: Forgot to upload example

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

    Re: Extracting certain data depending on criteria

    Your second worksheet is protected so can't test...but

    In order to create a single formula that you can copy down and be able to extract from both sheet, it would be advisable to have the same setup in both sheets...

    Then...

    You would apply the same helper formula in R2 of Timetabled Service sheet...

    Please Login or Register  to view this content.
    copied down.

    then in the "fixed" Frequent Service sheet R1, add formula:

    Please Login or Register  to view this content.
    and in R2, copied down:

    Please Login or Register  to view this content.
    In G1 of DDA sheet..

    Please Login or Register  to view this content.
    and in A3:

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: Extracting certain data depending on criteria

    Sorry about that, reposted with second sheet unlocked.
    Attached Files Attached Files

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

    Re: Extracting certain data depending on criteria

    See my reply anyways... you need to rearrange the second sheet to look like the first sheet for a formula that you can copy down and get results from both sheets in proper fields....

    ... try to apply my formulas and if you can't get it, attach a workbook of where you got to...

  13. #13
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: Extracting certain data depending on criteria

    Thank you for you suggestion, Unfortunatley I can not change the way the second form is designed, due to the way the information is recorder.

    I have entered you codes into the sheets to se what results i would get, First I never got any errors whihc is good, but i have noticed from the code that in a cell it looks like you are trying to extract two lots of data and display them into one cell. As you have both sheets within the formula within one cell.

    Im not trying to tell you that you are wrong, as im only a newbee at this, and I could be reading it wrong.

    G

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

    Re: Extracting certain data depending on criteria

    My formula is an IF() formula that says to look first, in Sheet 1, then if not there, look in Sheet2.. not pulling to lots and and entering in one cell.

  15. #15
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: Extracting certain data depending on criteria

    What happens is it is in both Sheets, what happens then? Is it possible to pull all the information from one sheet and then the 2nd sheet ( if data is conatined in the second sheet) ??

    G

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

    Re: Extracting certain data depending on criteria

    Again, if you setup both sheets to be of the same format, then the formula looks at the first sheet and extracts all relevant info..when all that info is taken out, then it looks in the second sheet and pulls all the relevant data from there...

    Maybe, since you can't change the 2nd sheet, change the 1st to match the 2nd and apply the formulas (adjusted as necessary).

  17. #17
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: Extracting certain data depending on criteria

    After a bit of fidderling i think i have it working, the only issue i have at the moment, all the cells show the formula, except when i enter the formula into a cell for the ID number, it displays the ID number as it should but when you go back to the cell the cell only contains the ID number and not the formula

    Also every time i enter one bit of data into the sheet it then re calculates the sheet and this takes time, is there a way of speeding this up?

    G

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

    Re: Extracting certain data depending on criteria

    Can you post something showing what you mean...

    As far as faster... not sure if you can.. I used helper columns to avoid array formulas in order to make it most efficient...

  19. #19
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: Extracting certain data depending on criteria

    I have got the code working and the speed seems ok, the only two things that are bug me are that the rows will not auto expand, even though I have txt wrap on. The data is being pulled from another sheet which has expanding rows. I entered a bit of code that expands the rows, but when empty they do not defualt back to the set height.

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

    Re: Extracting certain data depending on criteria

    I am not really a coder... so can't help you there.. but you might want to post that question separately.. as it is really a new question and belongs in the programming forum.

    And then please mark this thread as Solved.

+ 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