+ Reply to Thread
Results 1 to 4 of 4

Cell input number as row number in function between sheets

Hybrid View

  1. #1
    Registered User
    Join Date
    10-27-2010
    Location
    USA
    MS-Off Ver
    Excel 2003,2007
    Posts
    4

    Cell input number as row number in function between sheets

    Hello,

    I am trying to use a input cell to average a row from the input number down. So if i put a number in my input box I would like my average function to use that row number that was imputed to the end of the data.

    I can not get it reference another excel sheet it gives me #REF! error when i try to use column L from sheet "XRF Data Paste Here"

    What is wrong

    Where H17 is the input cell and " is the name of the sheet that data is on. with this code i am trying to pull data from column L

    =AVERAGE(INDIRECT("'XRF Data Paste Here'!L"&H17&":'XRF Data Paste Here'!L"))

  2. #2
    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,696

    Re: Cell input number as row number in function between sheets

    I think it needs to be something like:

    =AVERAGE(INDIRECT("'XRF Data Paste Here'!L" & H17 & ":L35"))

    Take out the second sheet reference and include the end cell, assuming the value in H17 is the start cell. In this case, I added a 35 to complete the range

    Regards
    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


  3. #3
    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: Cell input number as row number in function between sheets

    Hi,

    Try

    =AVERAGE(INDIRECT("'XRF Data Paste Here'!L"&'XRF Data Paste Here'!H17&":"&"L"&1000))
    Change the last row number (1000) as appropriate.

    HTH
    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.

  4. #4
    Registered User
    Join Date
    10-27-2010
    Location
    USA
    MS-Off Ver
    Excel 2003,2007
    Posts
    4

    Re: Cell input number as row number in function between sheets

    Works great guys thanks. Now i thinking of taking it to the next level. I am not to good at writing code.

    I am thinking of doing a macro that will search a column M for a code SC (stable conditions), look at the time stamp in column N. Then find that time or before on Sheet XRF Data Paste here and export that row number to a specific cell.

    Thanks for the help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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