+ Reply to Thread
Results 1 to 20 of 20

LOOKUP: Trying to deglitch repeats in data

  1. #1
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    LOOKUP: Trying to deglitch repeats in data

    Hello Forum, this is my first post. I'm relatively inexperienced, but found Lookup almost accomplishes what I want.

    I have a form with on the left mice born on various dates, and glucose readings taken on various dates. I want to change it on the right into the readings sorted by how many weeks old the mouse is. First I put in a row under the date of the glucose readings how many weeks this is from the beginning of the year using DATEDIF. I incorporated an IFERROR and an ISBLANK to make it ignore dates where there was no glucose reading taken, and to not return zeros.

    The glitches that remain are:
    In the created columns for the mouse age at reading, if there is not new data for that age it repeats the previous data.
    and
    If there are two dates' readings with the mouse being the same age, rounded off, it only gives the second reading data. I added below a couple of lines so that you can see that the 2/7/2020 mouse is 8.6 weeks old on the 4/7 reading date, and 9.4 weeks old on 4/13. Both round off to a 9 week old mouse. It only returns "30", read on 4/13, and the "20" on 4/7 is not shown.

    SmallAdvicePng.jpg.png


    The formula I used for the cell I6 (which is column: Age 8 Weeks, and row: Mouse B) is: =IFERROR(IF(ISBLANK(LOOKUP(I$2+0.5+DATEDIF($B$2,$B6,"D")/7,$C$3:$F$3,$C6:$F6)),"",LOOKUP(J$2+0.5+DATEDIF($B$2,$B6,"D")/7,$C$3:$F$3,$C6:$F6)),"")

    Thankyou anyone. It may be difficult to unravel my train of thought, or intention, but thanks for looking.

    Michael
    Last edited by mchlbrmn; 08-07-2020 at 07:14 PM.

  2. #2
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    Re: LOOKUP: Trying to deglitch repeats in data

    Trying to get screenshot again:
    Attached Files Attached Files
    Last edited by mchlbrmn; 08-07-2020 at 07:31 PM.

  3. #3
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: LOOKUP: Trying to deglitch repeats in data

    Hello mchlbrmn and Welcome to Excel Forum.
    It may help someone understand if you also manually include the values you want to see in columns H:N.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  4. #4
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    Re: LOOKUP: Trying to deglitch repeats in data

    Thanks for the advice. I'll try reposting, with more explanation, and I'll delete this if I figure out how.

    Hey, I can't figure out how to upload an Excel file. I go to Manage Attachments and select it, but I can't get it in. I think it has an error that I need to post a few times first, but I managed before??
    (This is so frustrating.)
    Last edited by mchlbrmn; 08-11-2020 at 04:38 PM.

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: LOOKUP: Trying to deglitch repeats in data

    Perhaps edit post #2 by removing the existing .xlsx file attached there and then attaching an updated file.
    After doing that add a new post to the thread so that we will receive a notification.
    Let us know if you have any questions.

  6. #6
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    Re: LOOKUP: Trying to deglitch repeats in data

    I posted a new thread. I'd delete this one if that's possible.
    I had problems posting even on a new thread. I guess I have to attach, preview, then 'Manage Attachments' again, and then maybe the attachment appeared in the preview (?). It's not intuitive, I still don't know if I understand how it works, and I spent a lot of time trying to post. It's probably simple once one is used to it, but even trying to follow directions I found it to be difficult.

    Anyway, feel free to delete this post moderators.

    (Weird, now the "Go Advanced" button is there when I don't need it. Nope, it's disappeared again.)
    Last edited by mchlbrmn; 08-12-2020 at 03:39 PM.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: LOOKUP: Trying to deglitch repeats in data

    Continue in this thread, please. Attach the workbook here.

    We don’t close threads just because of problems posting attachments - if you follow the instructions at the top of the page, you won’t have any problems. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    Re: LOOKUP: Trying to deglitch repeats in data

    To AliGW I thought it would be easier for people not to have to read through stuff about being unable to figure out how to delete the post, and an Excel attempt that was superseded by a clearer one, on advice from the forum. People may not read on after I said I wanted to delete the post, and had posted a new one. If you are able to close a post, why not close the bad one?

    " if you follow the instructions at the top of the page, you won’t have any problems. Thanks." You are mistaken. Maybe I'm mentally deficient or something, but I attempted to carefully follow the instructions, rereading them multiple times, and I did have problems. It's very different doing something you've done many times, versus seeing it for the first time. I wasted over an hour working on attaching a file. I'll try again in the next reply.

  9. #9
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    Re: LOOKUP: Trying to deglitch repeats in data

    Newer workbook below.

    Problems I have, are:
    It repeats data when I don't want it to, until it finds new data.
    When there are two results that should go in the same place, it only shows the later one.
    I (am attempting to) post an attachment with an example form with the simple LOOKUP formula, then below the same thing repeated with stuff to avoid errors and zeros from being displayed, and then finally below I show what I would like to see with corrections in bold (or the same information conveyed in any way suggested).

    I use the LOOKUP function, because as far as I know the apparently more modern HLOOKUP wouldn't work because it would only look up data from one fixed row, not a relative position (?).

    What I have is data from mice with the various mice's dates of birth, and columns of glucose readings taken from the mice on various dates. My aim is to get the data sorted (to the right) not by the date the glucose was read, but by how old the mice are when the glucose was read.

    Thanks for any help.
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: LOOKUP: Trying to deglitch repeats in data

    Perhaps this qualifies as "any help" as it isn't exactly like you want:
    1. The formula that populates C39:F40 is: =ROUND(DATEDIF($B39,C$25,"D")/7,0)
    2. The formula that populates H28:O37 is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    Re: LOOKUP: Trying to deglitch repeats in data

    Thanks JeteMc I'm sure "round" makes more sense than my workaround. I'll study the other formula.
    I appreciate the help.

    AliGW Sorry if I sounded snippy; I was frustrated. I saw later on the other thread why you left this one.

  12. #12
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: LOOKUP: Trying to deglitch repeats in data

    Try to shorten it a bit and eliminate un-needed semicolon:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Quang PT

  13. #13
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    Re: LOOKUP: Trying to deglitch repeats in data

    JeteMc and bebo, that's terrific. Thank you! You've done magic. Hopefully I can transfer it to my work.

    How can I work with the results generated? When I try a simple function like AVERAGE or SUM on the resulting cells, I get errors, or zero.

  14. #14
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: LOOKUP: Trying to deglitch repeats in data

    The results are mixed: 20 or "20,30", so treated like text.

  15. #15
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    Re: LOOKUP: Trying to deglitch repeats in data

    I need to work with the results sorted by age in weeks, as you got it to appear so well. It doesn't need to appear exactly as I requested originally, but is there a route to get numbers I can work with, to summarize data? I would like to get averages of data from subgroups of the mice.

    I'm sorry I didn't explain better from the start where I was going with the numbers.
    Last edited by mchlbrmn; 08-14-2020 at 01:46 AM.

  16. #16
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: LOOKUP: Trying to deglitch repeats in data

    I came up with splitting weeks into two halfs, then sum and average at the bottom for each week age per mouse group.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    Re: LOOKUP: Trying to deglitch repeats in data

    Thank you so much again Bebo021999 . That works great for all the 2/7 mice. It says First Half and Second Half, but it works separating the numbers even if mice were born in the same half of a week. Great!
    There's no sorted results for the last line, with a mouse born on a different day (2/10). In my actual data there are mice born on many dates, listed in the colunm in a random order (it's sorted by other things).
    Can it work mixed birth dates?

    I see you have line 13 in the formula for the 2/10 mouse on line 12. I put a date in line 13, and results appear for the 2/10 mouse, but if I change the date in line 13, the results change. That shouldn't happen. [Note, see below, now fixed.]

    I'm still a helpless baby, and it will take time for me to figure out all the functions that you used. But I will, I hope, eventually! But, maybe I can get my data for this experiment done sooner before my clunky brain has caught up.

    Added on:
    OK, it looks like it was a simple typo. If I change the 13 to a 12, it now works correctly. Wonderful, Don't know how it works (yet), but I'll see if I can use it on my actual data!
    Last edited by mchlbrmn; 08-14-2020 at 01:21 PM.

  18. #18
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    Re: LOOKUP: Trying to deglitch repeats in data

    I think it worked. .
    Magic! (I'm like a preindustrial civilization seeing jet planes for the first time).
    Only thing is, it has zeros in empty cells (no big problem)

  19. #19
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: LOOKUP: Trying to deglitch repeats in data

    Yes, it was my typo,
    In row 4
    =IFERROR(INDEX(4:4,AGGREGATE(15,6,COLUMN($C$1:$F$1)/(ROUND(($C$1:$F$1-$B5)/7,0)=LOOKUP(2,1/($H$1:H$1<>""),$H$1:H$1)),LEFT(H$2)+0)),"")
    Working in row 4, change $B5 to same line $B4, then it should work.

  20. #20
    Registered User
    Join Date
    08-07-2020
    Location
    Boston, MA, USA
    MS-Off Ver
    MS Office Pro Plus 2019
    Posts
    18

    Re: LOOKUP: Trying to deglitch repeats in data

    I finished applying the formula to my data, and did further analysis.
    Your help was invaluable.
    thanks again!

+ 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] Copy/Pasting Data Between Cells via Macro, Data Repeats to End of Table
    By scooter155 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-01-2017, 01:44 PM
  2. [SOLVED] Pulling individual data in pivot table when data repeats. Need Calculated Field
    By ChemistB in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-11-2017, 02:12 PM
  3. [SOLVED] Add Quantities if Data Repeats
    By Ocean Zhang in forum Excel General
    Replies: 5
    Last Post: 07-15-2014, 10:28 AM
  4. Replies: 6
    Last Post: 12-09-2012, 09:00 PM
  5. Formulae for: 4 most repeats,4 least repeats in a series of numbers
    By Sedge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2010, 04:56 AM
  6. Replies: 3
    Last Post: 07-04-2008, 07:42 PM
  7. Repeats of data
    By rdubya in forum Excel General
    Replies: 1
    Last Post: 09-16-2007, 10:02 PM

Tags for this Thread

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