+ Reply to Thread
Results 1 to 12 of 12

Getting data to display from an adjacent cell

  1. #1
    Registered User
    Join Date
    02-04-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Getting data to display from an adjacent cell

    Hopefully i can explain this clearly enough

    I am trying to analyse a whole heap of data generated by an image analysis package. The data is exported out in to excel, I then need to be able ot rearange it a bit and export it out to another program.

    I have attached a smaller version of the data as an example. The example data set only contains 3 image planes with ~100 entries for each. A full data set contains 96 planes and ~2000 entries each.

    So what i want to do.

    I want to setup a workbook i can dump this data into and have it spread everything out over 96 different sheets (1 for each plane).

    I can get it to do it for the first lot of data using a IF command like =IF('Object Data'!B:B=1,'Object Data'!D3,)

    But that only really works for the first plane, as the starting cell for plane 2 is always going to be different.

    So what i need is a formula that will say: look at the plane column, if it equals a certain value print out the value for the other cells in that row.

    Is that possible?

    Thanks
    Attached Files Attached Files
    Last edited by cammyron; 09-09-2009 at 02:41 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Getting data to display from an adjacent cell

    You could use formulae sure, but if you have lots of data and lots of sheets it will get a little excessive, I would suggest a quick VBA based approach, based on your file something like the below should work:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-04-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Getting data to display from an adjacent cell

    Ok So where do you live, I need to give you abig kiss. That worked perfectly.

    Can i impose one more question?

    When I have the data seperated into all the different sheets I need to have a series of cells put at the top of each data set. It is some header information that I need to have assosciated so i can get the data into another program.

    My VBA skills are essentially non existent so i have no idea how to go about this.

    I have attached a spread sheet with an example of the header needed.
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Getting data to display from an adjacent cell

    It's not clear if the content of the header cells (ie column B) will need to adapt per sheet but a basic approach would be to store the required header info on a separate sheet and simply copy that into each new sheet as it is added to the file, see attached (note .xlsm format).
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-04-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Getting data to display from an adjacent cell

    once again you are a legend. Thank you.

    The only part of the header that will potentially need to change is the $FIL parameter. It shoudl be the name of the file going to be saved. So in this example it would be the sheet name ie. _1.txt, _2.txt etc.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Getting data to display from an adjacent cell

    If we can make the assumption that this is a saved file (we assume it is obviously) then on the HEADER sheet insert the below into cell B4:

    Please Login or Register  to view this content.
    When the header is copied the formula will update accordingly
    (note: CELL is a Volatile formula but given it's being used in moderation this is no big deal in this instance)

    You could adapt the code to do the above but you would need to insert a few extra bits to establish where exactly the field of interest is located within th header ... if the Header layout is rigid, ie you will never alter HEADER sheet, and you prefer not to use any formulae then (having disregarded the above) you could add a line below this one in the existing routine:

    Please Login or Register  to view this content.
    such that the code would read:

    Please Login or Register  to view this content.
    The choice as they say is yours.

  7. #7
    Registered User
    Join Date
    02-04-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Getting data to display from an adjacent cell

    Thanks again.

    The forula you posted will be enough, though when i put it in it doesn't update right away. I need to click the cell, click up in the formual bar and then click away. After that it updates like it should.

  8. #8
    Registered User
    Join Date
    02-04-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Getting data to display from an adjacent cell

    all good. I have solved it myself the workbook needs to be saved for that formula to update itself.

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Getting data to display from an adjacent cell

    the workbook needs to be saved for that formula to update itself.
    yep, as inferred in my prior post

    I had assumed given the VBA routine present in the file that the file would be saved.

  10. #10
    Registered User
    Join Date
    02-04-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Getting data to display from an adjacent cell

    Ok so it all works great, excpet i stuffed up a little in explaining what i wanted.

    The individual sheets need to have only the header info and the data drom the aread and shape factor columns below it, not all the other data. So the resulting sheets nest need two columns (A and B) with the header and the two columns of data.

    DonkyOte can you PM me with your real name as i would like to recognise you in any resulting publications of this data for your help.

  11. #11
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Getting data to display from an adjacent cell

    You just need to change this section of the code from:

    Please Login or Register  to view this content.
    to:

    Please Login or Register  to view this content.
    Re: accrediting me - don't worry about that.

  12. #12
    Registered User
    Join Date
    02-04-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Getting data to display from an adjacent cell

    once again you are a legend. I did change one bit of it though so that it didn't copy the column headers from the object data page. Had no idea what i was doing, but took a guess and got it right

    Once again thanks for your help. This has saved a lot of scientists a lot of time

+ 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