+ Reply to Thread
Results 1 to 13 of 13

Automatic adjustment of cell references

  1. #1
    Registered User
    Join Date
    02-23-2021
    Location
    England
    MS-Off Ver
    2010
    Posts
    7

    Automatic adjustment of cell references

    Hi,
    I was just wondering if it was possible to adjust the cell reference automatically according to another value.
    Currently trying to analyse data for a number of scores. The number of people taking the test changes each time.
    Im calculating a t.test based on their scores but obviously the cell references change depending on number of scores.


    E.G. Currently looks like =t.test(B6:M6,B16:M16,2,1).

    This assumes 12 scores present. But if there were only 6, is there a formula to automatically change the reference to

    =t.test(B6:G6 etc...

    Thank you so

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Automatic adjustment of cell references

    a sample spredsheet would help, see yellow banner
    But an INDIRECT() with a count() may help to change the column reference. May also need the Address/column() function as well

    SO B6 stays the same and the column C, D,E,F,G, H, etc changes dependant on how many replies are present

    But I think i need to see some examples of different tests and people and expected results
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    02-23-2021
    Location
    England
    MS-Off Ver
    2010
    Posts
    7

    Re: Automatic adjustment of cell references

    Thank you for your help.

    I have uploaded a blank sample of the spreadsheet being used.
    My example mainly refers to the number of students taking part. As this varies the cell reference in certain formulas (such as average) change depending on that number.

    Thank you
    Attached Files Attached Files

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Automatic adjustment of cell references

    can you explain a little more detail, i dont understand your spreadsheet content, so i need some guidance since you said

    The number of people taking the test changes each time.
    How does excel know how many people took the test , what area of the sheet - All i can see is the same students A to F = 6

    Currently looks like =t.test(B6:M6,B16:M16,2,1).
    where is this formula - what cells 12 columns

    Sorry trying to help, but just dont follow

  5. #5
    Registered User
    Join Date
    02-23-2021
    Location
    England
    MS-Off Ver
    2010
    Posts
    7

    Re: Automatic adjustment of cell references

    Sorry for not being clear.

    So currently there is no calculated way in which excel knows how many people took the test.
    Currently the only way to know would be for data to be entered on the sheets Student 1-12 (the results of replies on there are then copied into the cells B5 - M10)

    The A-F in Column A actually refers to a legend - the student count in 1-12 from B-M.

    =t.test(B6:M6,B16:M16,2,1). Is located in D46

    To try and be clear...(again, sorry)

    I would like the above formula to effectively adjust to the number of replies that are present in rows 5-10.

    I.e. There may only be 10 replies in row 5 and thus i would like the forumla automatically to change to

    =t.test(B6:K6,B6:K16,2,1)

    To thus exclude any blank cells containing the value of 0 which would effect the t.test

    I hope this has helped

    Thank you

  6. #6
    Registered User
    Join Date
    02-23-2021
    Location
    England
    MS-Off Ver
    2010
    Posts
    7

    Re: Automatic adjustment of cell references

    Apologies
    Error in

    I.e. There may only be 10 replies in row 5 and thus i would like the forumla automatically to change to

    I meant

    "
    I.e. There may only be 10 replies in row 6 and thus i would like the formula automatically to change to..."

  7. #7
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Automatic adjustment of cell references

    will any of the replies actually result in zero, 0 as a valid answer in the cell?

  8. #8
    Registered User
    Join Date
    02-23-2021
    Location
    England
    MS-Off Ver
    2010
    Posts
    7

    Re: Automatic adjustment of cell references

    Yes 0 is a valid reply

  9. #9
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Automatic adjustment of cell references

    as zero is valid, then how will excel know how many students have replied in columns B to M - as the default is zero and can also be a valid number

    There may only be 10 replies in row 6 , But if a student replies 0 to all 10 - it will still show the 12 zeros in B6:M6

  10. #10
    Registered User
    Join Date
    02-23-2021
    Location
    England
    MS-Off Ver
    2010
    Posts
    7

    Re: Automatic adjustment of cell references

    My thought was whether a user could input the number of students directly into another cell, giving excel the direct value.

    I'm thinking that it's likely impossible. Asking too much i think

  11. #11
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Automatic adjustment of cell references

    My thought was whether a user could input the number of students directly into another cell, giving excel the direct value.
    that may work
    And would for that sheet , only ever be the same number of students replying for all rows

    Also is it only the range D46 to D50 thats impacted by the range change

    Assuming the number of students is the same throughout

    This is a bit clunky and can be further automated - but for showing the working i have laid it out longhand , if you like

    The number of Students are entered into N3 - that is then used to decide on the columns to include

    So Range will be B to whatever letter the number of students represent
    As B is column 2 , we will need to add 1 to the column to get the final column - ie 4 Students = B,C,D,E = column 2 to column 5
    I use
    SUBSTITUTE(ADDRESS(1,$N$3+1,4),"1","")
    this returns the letter

    Now we need to build up the ranges we want to use
    to fit into the function B5:M5 and B15:M16 and for the 6 rows - B5, 6,7,8,9,10
    so i have built that in longhand in D54 to E59
    In cells D52 i have put the first starting row - in this case 5 and in E52 = 15
    BUT that could be automated - depending if you are likely to change the layout

    Now to calculate the ranges
    ="B"&B54&":"&SUBSTITUTE(ADDRESS(1,$N$3+1,4),"1","")&B54
    So we have B then we concatenate the value in B54 , which is 5 , then the : and then get the letter for the number of students , then add the row again from B54

    now for t.test
    =IF(T.TEST(INDIRECT(D54),INDIRECT(E54),2,1)<0.05,"<0.05",">0.05")

    we want to substitute the range with the value in D54 and E54
    to get the formula to use the contents of a cell in a formula - we use indirect

    As i say a bit clunky and a bit longhand to spellout what i have done - can all be simplified, but wanted to make sure it actually achieved the result

    I have also change the average in cell O5 to use the same range as derived from number of students

    thoughts?
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    02-23-2021
    Location
    England
    MS-Off Ver
    2010
    Posts
    7

    Re: Automatic adjustment of cell references

    All i have to say is WOW.

    As you've probably gathered i'm new to using excel.
    Im going to have to read your last post a few times to get my head around it.

    Thank you so much!

  13. #13
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Automatic adjustment of cell references

    ok, you re welcome - BUT as i say it is clunky and there will be a better way to setup and possible avoid so many helper columns

    But i will wait and see what issues you come up with or when you confirm its all working perfectly

+ 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. Replies: 2
    Last Post: 11-02-2020, 05:24 PM
  2. Replies: 2
    Last Post: 06-15-2014, 07:40 AM
  3. Replies: 1
    Last Post: 06-08-2013, 06:50 AM
  4. Automatic Target adjustment
    By TheRetroChief in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-03-2008, 12:27 PM
  5. automatic adjustment
    By daidipya in forum Excel General
    Replies: 1
    Last Post: 06-08-2006, 09:50 AM
  6. automatic field adjustment
    By Sabrick in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2006, 10:25 AM
  7. Automatic row height adjustment
    By nsv in forum Excel General
    Replies: 5
    Last Post: 01-27-2006, 03:38 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