+ Reply to Thread
Results 1 to 15 of 15

Automatically selection x+4th cell down from current row as next value in formula

  1. #1
    Registered User
    Join Date
    08-05-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    9

    Automatically selection x+4th cell down from current row as next value in formula

    Hi all,
    First off, thanks in advance for your help with my issue. I am usually able to solve my excel issues but I can’t seem to crack this one, it must be possible but I think I am just not using the right keywords to search or just not understanding properly.

    You can look at the sample data I put in below (yes I know its not a real formula, I just wanted to get the point across ). Each sample matrix contains 12 individual data points (indicated by the positions on the matrix on the left). I want a ‘master’ matrix at the top of the page, which will continue to count any new matrices that I copy paste in below the existing ones. If it were a closed data set (no more matrices to be added in the future) what I would normally do is take the AVERAGE(G9;G13;G17) and be done with it. But instead I want it to be AVERAGE(G9;G13;G17;G21;G25…) to eteCapture.PNGrnity,so it will always include the x+4th cell from the current position (or if its easier,G9 then G9+4*1, then G9+4*2, etc (but not just G9+4 and then 8 but rather G9 then 4 rows down, then 8 rows down, then 12 rows down, etc). I would then expand this to all the other positions in the matrix.

    I have a feeling I have over complicated this, but I can’t wrap my head around it. Can somebody help? I know I can just update the formula at the top each time I copy in new data, but it seems like there is a sleeker way to do this in Excel. Am I wrong?

    Thank you!!

    JB1

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Automatically selection x+4th cell down from current row as next value in formula

    Hi,

    Please upload the workbook. These things are always easier of we can see the request in context.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-05-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    9

    Re: Automatically selection x+4th cell down from current row as next value in formula

    Hi there,

    Thanks for your quick reply. I thought about that too but I really don't see how to upload files here... So I made it available here instead: https://www.dropbox.com/s/d69gocvy12...trix.xlsx?dl=0

  4. #4
    Forum Contributor
    Join Date
    05-06-2016
    Location
    Cluj, Romania
    MS-Off Ver
    2007-2010
    Posts
    220

    Re: Automatically selection x+4th cell down from current row as next value in formula

    Hi,
    Define Name Values with formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and for average use this in A2, drag down and toright
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    see attachamet
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Automatically selection x+4th cell down from current row as next value in formula

    Try this Array formula in B9, copied across and down.

    =AVERAGE(IF(MOD(ROW(G9:G17)-ROWS($1:1),4)=0,G9:G17))



    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  6. #6
    Registered User
    Join Date
    08-05-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    9

    Re: Automatically selection x+4th cell down from current row as next value in formula

    Hi Glenn and TudyTBH

    Thank you both for your replies.

    Glenn--I tried your formula but it throws up an error, when I hit OK it highlights the ,4 you have right after the ROWS function. Not sure how to troubleshoot that.

    TudyTBH--thank you for that. Your solution does work in your sample spreadsheet and I will use it in a pinch but I have no idea how to modify it for future dataset and as such if I can get the Array formula mentioned by Glenn to work as it seems much simpler to work with, at least to me.

    Thanks to everyone for their input!

  7. #7
    Registered User
    Join Date
    08-05-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    9

    Re: Automatically selection x+4th cell down from current row as next value in formula

    Hi again Glenn,

    Ok I got it to return a value (by replacing the commas at ,4 and 0, with semi-colons (this is a french version of excel, which i hate working with btw, so maybe that makes a difference), but when I try it, I get the average as 4.2 in B2, which is the average of column G and not just G9, G13, and G17.

    Edit: ok I think changing that to semi colons messes up the Array portion of the function as I get the value even just by hitting enter. But when left as commas it still gives an error even with CTRL-SHIFT-ENTER (and I confirmed it is this same key combination for the french version of Excel)

    Thanks,
    JB1
    Last edited by jonbasha1; 08-05-2016 at 11:25 AM. Reason: Follow up info

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Automatically selection x+4th cell down from current row as next value in formula

    It does. Mainland europe uses ; we use ,

    If it's only the 3 you need... I'll be back...

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Automatically selection x+4th cell down from current row as next value in formula

    How's this Array Formula. Add any numbers belo your table and it doesn't affect the calculated averages. Indeed I'm certain that my previous version didn't, either. here's the file, though.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    08-05-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    9

    Re: Automatically selection x+4th cell down from current row as next value in formula

    Thanks Glenn

    As an update. I can confirm it recognizes as an array even after swapping the ; and translating the functions (Excel in a second language can be painful.........!). But yes pelase B9 would have to reflect average of only G9, G13, G17 (and G21, G25, G29, etc as I keep pasting in below). I understand how to extend the ranges of the formulae you gave me so that isn't a problem in the future.

    Thanks!!

    Edit: got ninja'd, sorry about that. To clarify, I want it to include the data pasted below as current averages... but only every 4th cell down from the starting cell (i.e. the same position on every new matrix pasted in). Not sure if this is possible with your formula as it is set to take average of entire column (within the range defined), but I could also jsut do that with =AVERAGE(G9:G19), no? Not trying to be snarky I just want to make sure I understand why you elaborated the formula as you did.

    Double thanks!
    Last edited by jonbasha1; 08-05-2016 at 11:37 AM.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Automatically selection x+4th cell down from current row as next value in formula

    The way you described your problem, it sounded (to me) that you wanted ONLY the first 3 values to be averaged... Back later...

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Automatically selection x+4th cell down from current row as next value in formula

    Try this array formula, good for 1000 rows.

    =AVERAGE(IF(MOD(ROW(G$9:G$1000)-ROWS($1:1),4)=0,IF($G$9:G$1000<>"",G$9:G$1000)))

  13. #13
    Registered User
    Join Date
    08-05-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    9

    Re: Automatically selection x+4th cell down from current row as next value in formula

    Bingo!!! Once "translated" it works perfectly!

    Thanks so much for your help Glenn! And for sticking with it. I was having trouble being able to describe it and you still saw through that to save the day, haha. Thanks again!

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Automatically selection x+4th cell down from current row as next value in formula

    You're welcome.

  15. #15
    Forum Contributor
    Join Date
    05-06-2016
    Location
    Cluj, Romania
    MS-Off Ver
    2007-2010
    Posts
    220

    Re: Automatically selection x+4th cell down from current row as next value in formula

    For maximum portability, define another name: "average" in uper-left corner of data average range (A2 in my example, and put this formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    now you can put tour table anywhere
    Attached Files Attached Files

+ 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] Cell automatically updates with current user
    By phbryan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-08-2016, 08:18 AM
  2. VBA - Autofill a formula where the current selection changes.
    By Goulding74 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2016, 11:25 AM
  3. Replies: 4
    Last Post: 11-24-2014, 05:55 PM
  4. How to automatically update a formula based on current date
    By stealthtrooper in forum Excel General
    Replies: 5
    Last Post: 04-22-2014, 04:12 PM
  5. Replies: 3
    Last Post: 03-17-2010, 05:42 PM
  6. [SOLVED] Stop Users From Selecting Another Cell Until Current Selection Receives Data
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-21-2009, 02:40 PM
  7. [SOLVED] how do i automatically insert the current author's name in a cell.
    By Nolin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-08-2005, 12:06 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