+ Reply to Thread
Results 1 to 6 of 6

The best group of cells within specific value

  1. #1
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    The best group of cells within specific value

    Hello forum,
    I'm trying to find the best position from about two months recording of GPS coordinates with mobile phones (so the file is huge)
    What I am trying to do is to pick out the records (column D) with the best group of cells within 100 meters based on ItemID (column C) just to get rid of large errors in GPS positions. I have sorted column C and D in ascending order and from this try to find the group of values that fit best for the 100 meter value.
    I tried this formula
    Please Login or Register  to view this content.
    but this works only if the first value always is correct and that is not always the case as the GPS signal can drift a lot (bad weather, signal-shadow, battery status, etc). The distance in meters is calculated from where the point is supposed to be and with this data I'm trying to see if I need to update with better coordinates later, using some sort of mean or median number. There can be big drifts within each itemID, it can be only a few that is within 100 meters, perhaps when there is a very few (< 10) in that case if possible extend the value to 200 meter at is most or else all from this ItemID should have errors and be ignored in my next step. I hope I explained well enough, the attached file is sample from the data I am using and the validation column (column E) is from the code above I been using that does not work for my purpose.

    Thanks
    Attached Files Attached Files
    Last edited by soreno; 09-30-2018 at 04:44 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: The best group of cells within specific value

    To start, you could use this simplified formula to replace your existing formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Aside from that, I think you are just asking to calculate the distance from the AverageIf value...

    Excel 2003 or earlier..
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Excel 2007 or later...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 09-30-2018 at 09:03 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: The best group of cells within specific value

    Tried both formulas (2003 and 2007), it gives the wrong result if you check row 134 to 164 where row 164 is "out of range" but the rest are within the range of 100 meters (20,6 lowest and 43,4 the highest). I get "ERROR" for all with ItemsID of 135548, only one is correct and that is the last one in that series, the rest should be value "OK"...
    Last edited by soreno; 09-30-2018 at 09:27 AM.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: The best group of cells within specific value

    Try a median if ...

    Confirm with Ctrl+Shift+Enter then copy down the column...
    =IF(ABS(D2-MEDIAN(IF($C$2:$C$864=C2,$D$2:$D$864,"")))>100,"ERROR","OK")

    It's not perfect. I'm not a mathematician. That's about as good as I can get.
    Last edited by AlphaFrog; 09-30-2018 at 09:46 AM.

  5. #5
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: The best group of cells within specific value

    Thanks, its not perfect but much better than what I have tried , it does cross over the range of 100 meters... guess I have to accept that. I will try on my large setup to see what happens first...

  6. #6
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: The best group of cells within specific value

    Using the formula kills the application, I guess it take up too much memory and you have an never ending spinning wheel.
    Could vba solve this? Or I have to split the file in several smaller versions for a fix...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Calculate group of cells to specific amount. How?
    By ton4ito in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-29-2017, 02:36 AM
  2. [SOLVED] color highlight a group of cells based on specific cells' value
    By jilaba in forum Excel General
    Replies: 4
    Last Post: 03-04-2017, 09:05 AM
  3. Sorting specific group of cells in all Worksheets
    By n_malley in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-24-2013, 07:55 AM
  4. [SOLVED] selecting a group of cells (that contain specific text) to copy
    By twiggywales in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-14-2012, 08:54 AM
  5. [SOLVED] If the value of a group of cells is over a specific amount
    By timmtamm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2012, 02:18 PM
  6. [SOLVED] Protecting a group of specific cells
    By rwab in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-14-2009, 04:39 PM
  7. [SOLVED] How can I use the COUNTIF formula on a group of specific cells?
    By 1day@atime in forum Excel General
    Replies: 3
    Last Post: 08-03-2006, 08:05 AM

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