+ Reply to Thread
Results 1 to 6 of 6

Problem selecting required cells for formula

  1. #1
    Registered User
    Join Date
    01-03-2014
    Location
    Belfast
    MS-Off Ver
    Excel Mac 2011
    Posts
    3

    Problem selecting required cells for formula

    Hi

    Can anyone tell me how i can select the most recent 10 cells from a list of data to be included in a formula. I have selected it manually, for example F122:F131. This is fine but i don't know how i can put it so that it will update to the 10 most recent results when i input another line of data. So when i put in more data it stays on the previously selected. I want it to move shift down to include the new data but only the 10 most recent.

    I would appreciate any help.

    Regards

    Myles

  2. #2
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Problem selecting required cells for formula

    Hi Myles, Welcome to the forum!

    If you want to add them, =SUM(INDIRECT("F" & COUNT(F:F) -9 & ":F" & COUNT(F:F)))

    The INDIRECT("F" & COUNT(F:F) -9 & ":F" & COUNT(F:F)) part of the formula counts the number of rows being used in column F.

    Note: It assumes that you don't have any totals or anything else in the column. If you do, you will have to adjust the count to allow for this. eg. COUNT(F:F)-1 if you have a total or something.

    Hope this helps,

    David

    Please remember, your request is clearer if you attach a sample workbook.
    - Click on Go Advanced and click on the Paper Clip.
    When you reply please make it clear WHO you are responding to by mentioning their name.
    If this has been of assistance, please advise. A little thanks goes a long way.
    - Please click on the *Add Reputation button at the bottom of helpful responses.
    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Problem selecting required cells for formula

    Define a Dynamic Named Range, nrColF as:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And then use the Array Entered formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If entered correctly, using Ctrl-Shift-Enter, this will display as:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    You could use whole column references but that would make the workbook very slow.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Problem selecting required cells for formula

    Hi and welcome to the forum

    As with most things in excel, there are various ways of doing the same thing. here is another option...
    =SUM(OFFSET($F$1,COUNT($F:$F)-10,0,10,1))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    01-03-2014
    Location
    Belfast
    MS-Off Ver
    Excel Mac 2011
    Posts
    3

    Re: Problem selecting required cells for formula

    Thanks for your help, i can't figure how to translate that into my sheet. I should have been more specific as to what it is i'm trying to do. I have a list of results on one page in a certain column i.e. A letter in each cell, W/L/D. On another page i have a formula which calculates the 'points obtained' for the previous 10 results so to speak. The formula is as follows. I'm not sure if i've done it the most efficient or smartest way but i'm fairly novice to excel.

    =COUNTIF(Sheet2!E166:E175,"W")*3+COUNTIF(Sheet2!E166:E175,"D")

    What i'm trying to do is find out how i can get the "sheet2!E166:E175" part to update when i enter a new line on the results column.

    I hope this explains a little better!

    Regards

    Myles

  6. #6
    Registered User
    Join Date
    01-03-2014
    Location
    Belfast
    MS-Off Ver
    Excel Mac 2011
    Posts
    3

    Re: Problem selecting required cells for formula

    Hadn't seen all the replies but managed to get it working using the offset:

    =COUNTIF(OFFSET(Sheet2!E176,-11,0,11,1),"W")*3+COUNTIF(OFFSET(Sheet2!E176,-11,0,11,1),"D")

    Thanks everyone for all your help.

    Regards

    Myles

+ 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: 08-01-2013, 03:34 AM
  2. [SOLVED] Problem Selecting a Range of Cells with Unknown Row Length - Macro
    By ahilty in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-11-2013, 12:41 PM
  3. [SOLVED] A problem getting Excel cells to subtract C-D-E to get the required result.
    By bev in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-15-2013, 09:51 PM
  4. Formula to display required cells
    By filmvid in forum Excel General
    Replies: 3
    Last Post: 11-28-2011, 01:09 PM
  5. Selecting and editing unlocked cells problem
    By John Keith in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2005, 05:32 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