+ Reply to Thread
Results 1 to 9 of 9

Range look up based on number in cell

  1. #1
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Range look up based on number in cell

    Hi,

    Is there a way to change the range of a formula based on a number entered in a cell?
    I.e
    If my sum is looking up d1 to d7 It is because with two other cells the numbers 1 and 7 are entered.

  2. #2
    Forum Contributor
    Join Date
    10-07-2011
    Location
    India, Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    212

    Re: Range look up based on number in cell

    That is possible.

    Create range by using address function and then use indirect function.

    Regards,
    Suhas

  3. #3
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Re: Range look up based on number in cell

    ive never used an address formula, could you show me an example

  4. #4
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Re: Range look up based on number in cell

    if i have a 1000 rows of data and i enter 1 in a cell and 100 in another cell, i only want the range to look up 1 - 100 rows.

  5. #5
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: Range look up based on number in cell

    =SUM(OFFSET(A1,0,0,6,1))

    this will sum from A1 to A7
    or =SUM(OFFSET(A1,b1-1,0,b2-1,1)) ' where b1 and b2 are from and to row numbers

  6. #6
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Re: Range look up based on number in cell

    Hi Sadath,

    I would have to edit to formula to change the look up, can i enter a number in a different cell to change the lookup?

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Range look up based on number in cell

    Quote Originally Posted by namluke View Post
    Hi,

    Is there a way to change the range of a formula based on a number entered in a cell?
    I.e
    If my sum is looking up d1 to d7 It is because with two other cells the numbers 1 and 7 are entered.
    Try
    =SUM(INDIRECT("D"&A1&":D"&A2))
    here you have to change A1 & A2 according to your needs
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  8. #8
    Forum Contributor
    Join Date
    10-07-2011
    Location
    India, Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    212

    Re: Range look up based on number in cell

    Write below formula
    =SUM(INDIRECT("A"&C1&":"&"A"&D1))
    C1= First row
    D1= last row

    Regards,
    Suhas

  9. #9
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Re: Range look up based on number in cell

    Excellent thank you Pangam

+ 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. assigning cell value based on a number range
    By dzedncnfused in forum Excel General
    Replies: 2
    Last Post: 09-11-2013, 07:07 PM
  2. [SOLVED] Enter a number in one cell based on the range of another
    By dawondr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-25-2013, 12:30 PM
  3. Replies: 1
    Last Post: 07-18-2013, 10:11 AM
  4. [SOLVED] Populate Cell Based on Where Number Falls into Range
    By BHR in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-03-2012, 07:29 PM
  5. background cell color based on number range
    By cjpref in forum Excel General
    Replies: 1
    Last Post: 09-01-2012, 09:01 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