+ Reply to Thread
Results 1 to 7 of 7

Transpose and filter

  1. #1
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Cardiff
    MS-Off Ver
    2003
    Posts
    123

    Transpose and filter

    I have some data that I need to re-organise so that it looks a lot nicer and easier to read. Basically I have a list of site names with dates and then a result. But I want to get it into the format of (column headers) name, date, chemical 1, chemical 2, chemical 3.

    This part I can managed, but when i transpose the information I realised that there could potentially be several readings for the same site on the same date. I would like to get it so that all readins taken on the same day are in one line eg:

    name date chemical 1 chemical 2 chemcial 3
    site a 01/01/09 0.1 0.0 1.5
    site a 05/02/09 0.1 0.3 0.9
    site b 01/01/09 1.2 1.7 <0.01


    where as at the moment I am getting

    name date chem 1 chem 2 chem 3
    site a 01/01/09 0.1
    site a 01/01/09 0.0
    site a 01/01/09 1.5
    site a 05/02/09 0.1
    site a 05/02/09 0.3
    etc
    Attached Files Attached Files
    Last edited by Back2Basics; 02-10-2009 at 08:24 AM. Reason: Added spreadsheet

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

    Re: Transpose and filter

    One approach... to keep file size down I've only inserted a few rows of formulae - you should copy the formulae down as required.

    If you prefer to do formulae-less you could use VBA.

    EDIT: Scrap that -- just re-read your posts...

    What happens if you have multiple lines on the same day for the same Determinand ?
    Attached Files Attached Files

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

    Re: Transpose and filter

    See revised approach ... I think it's along the right lines...

    Again, I have only inserted a few formulae on both sheets so you will need to copy down accordingly to get final results.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Cardiff
    MS-Off Ver
    2003
    Posts
    123

    Re: Transpose and filter

    Yeah I don't really have a clue about VBA tbh. I would like to try it at some point but don't know where to start.

    In answer to your question there will never be the same det repeated on the same day, as these samples are done in person it wont get taken twice.

    However this isn't quite what i have been trying to achive. I have found a way of getting what you have done already unfortunately.

    But then i realised that it is niced than having alist but not the best way to view it as the same date for each site can be repeated. I then used this formula:

    =VLOOKUP($A53&":"&$B53&":"&C$1, GWQMN_1ST_EXTRACT_Query!$C$1:$E$1716, 3, 0)

    (for the nitrates column)

    and copied to over the other two, this gave me all the available readings for the same date, but again i have several copies of this.

    What i want is as the above formula but only one row for each site for that particular date. Is there a way of doing this, even if it is using vba and this will save me a lot of time in the future.

    At the moment I am copying the above formlua to all cells and then sorting by date and manually deleting the duplicates, can take quite a while..... especially if there are say 20 dets, as there could be 20 rows for each site with the same date.

  5. #5
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Cardiff
    MS-Off Ver
    2003
    Posts
    123

    Re: Transpose and filter

    Thats is much better, thanks so much.

    Almost seems like my last post was either waste or you knew exactly what i was writing at the time of me writing it

    Thanks Don

  6. #6
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Cardiff
    MS-Off Ver
    2003
    Posts
    123

    Re: Transpose and filter

    unfortunately can't give you rep as you appear to be the last person i gave rep to, sorry

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

    Re: Transpose and filter

    Quote Originally Posted by Back2Basics
    unfortunately can't give you rep as you appear to be the last person i gave rep to, sorry
    Spread the Love...

+ 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