+ Reply to Thread
Results 1 to 7 of 7

Keeping formulas constant for only part of rows

  1. #1
    Registered User
    Join Date
    07-20-2018
    Location
    Exeter, England
    MS-Off Ver
    2016
    Posts
    7

    Keeping formulas constant for only part of rows

    Hi

    I have longitudinal data in an excel file that includes participant ID's in multiple rows. For each row, the participant ID has an associated age which changes as the participant ages. For example, data for participant 4 (4443 rows) is recorded with the participants age increasing from 44 to 59.

    I wanted to create a new variable of the participants age when they first entered the database i.e. for all 4443 rows I want their age to be derived from participants 4's first row (age 44). However, once it goes to the next participant (participant 7) I need it to record their initial age (48 in cell 4447) in cells 4447 to 9011. And so on with the next participants.

    I have attached a subset of the dataset as it is very large. Please can someone advise on a formula that may work for this problem?

    Thanks in advance.

    Phil
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Keeping formulas constant for only part of rows

    well this can slow it down but should work for you...
    =MIN(IF($A$2:$A$10693=A2,$D$2:$D$10693))
    it is an array formula so it activates by clicking in the formula in the formula bar and hitting control, shift and enter at the same time so the curly brackets appear {} at each end.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    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,418

    Re: Keeping formulas constant for only part of rows

    Since INDEX MATCH returns only the first match, I think this is all you need (non-array - normal formula):

    =INDEX($D$2:$D$10693,MATCH(A2,$A$2:$A$10693,0))
    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.

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Keeping formulas constant for only part of rows

    Ali, Better Choice, Better thinking. Should've thought of that first.

  5. #5
    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,418

    Re: Keeping formulas constant for only part of rows

    Yes, a rare moment of clarity here in Suffolk!!!

  6. #6
    Registered User
    Join Date
    07-20-2018
    Location
    Exeter, England
    MS-Off Ver
    2016
    Posts
    7

    Re: Keeping formulas constant for only part of rows

    Thank you very much Ali. This worked perfectly

  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,418

    Re: Keeping formulas constant for only part of rows

    You're welcome!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Adding rows and keeping formulas
    By jesusrms in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-01-2015, 08:50 AM
  2. Replies: 3
    Last Post: 09-26-2012, 04:29 PM
  3. [SOLVED] Keeping part of Formula constant whilst the rest changes.
    By Manuel Pedro in forum Excel General
    Replies: 2
    Last Post: 05-15-2012, 03:13 AM
  4. VBA changing Rows while keeping the columns constant
    By tmd2 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-10-2011, 04:12 PM
  5. Keeping formulas in inserted rows
    By bbvcbob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-16-2007, 05:36 AM
  6. Replies: 3
    Last Post: 03-07-2006, 03:30 PM
  7. adding new rows and keeping the same formulas
    By [email protected] in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-07-2006, 01:15 PM

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