+ Reply to Thread
Results 1 to 7 of 7

How to define a range in excel but with rows read from a fixed cell

  1. #1
    Registered User
    Join Date
    04-16-2015
    Location
    Simeria
    MS-Off Ver
    2021
    Posts
    97

    How to define a range in excel but with rows read from a fixed cell

    Hi

    if B1 =100 ( this number is not fixed)
    A1=B1


    How to wite a formula: =Countif(A1:A(value from B1) instea a specified row the value from B1

    i tried '=COUNTIF(A1:A INDIRECT(A1,TRUE),3)' but it does not work

    is it possible?

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

    Re: How to define a range in excel but with rows read from a fixed cell

    If your data layout is good (no potentially interfering stuff below your desired range), why not simply use:

    =COUNTIF(A:A,3)
    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

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: How to define a range in excel but with rows read from a fixed cell

    You would use the INDIRECT() function to return the entire reference (using Excel's text manipulation functions as needed to build the text string), not a part of the reference. Something like INDIRECT("A1:A"&A1)
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    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,053

    Re: How to define a range in excel but with rows read from a fixed cell

    But... if that's what you really want to do...

    =SUMIF(INDIRECT("A1:A"&B1),3)

  5. #5
    Registered User
    Join Date
    04-16-2015
    Location
    Simeria
    MS-Off Ver
    2021
    Posts
    97

    Re: How to define a range in excel but with rows read from a fixed cell - rectify

    Hi

    if B1 =100 ( this number is not fixed)
    D1=B1


    How to wite a formula: =Countif(A1:A(value from B1) instea a specified row the value from B1

    I tried '=COUNTIF(A1:A INDIRECT(D1,TRUE),3)' but it does not work

    I cannot use =countif(A:A,3) becose i star counting from A25 for example

    but the formula you indiocate is good

    Thank you
    Last edited by pedersenn; 08-25-2017 at 01:22 PM.

  6. #6
    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,053

    Re: How to define a range in excel but with rows read from a fixed cell

    Please look at Post 4. If that is NOT what you want, then...

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  7. #7
    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,053

    Re: How to define a range in excel but with rows read from a fixed cell - rectify

    Oh.. and when you are replying here - say WHO YOU ARE REPLYING to!!

+ 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] Define a Range for every N rows and do something if the cell is selected
    By ongcaps in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-22-2016, 04:21 PM
  2. [SOLVED] Define a range with a defined starting cell extending downward 10 rows
    By plans in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-13-2014, 02:49 AM
  3. Excel 2007 - Using Names to Define Cell Range
    By mab in forum Excel General
    Replies: 2
    Last Post: 08-26-2014, 11:08 AM
  4. excel 2007 macro need to have variable range of rows rather than fixed range
    By JW1028 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2013, 02:45 PM
  5. [SOLVED] Define a range of fixed number of columns, but unlimited number of rows
    By ccopac in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-22-2012, 02:23 PM
  6. Define a range containing the first 10 rows of a filtered list
    By Marco in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2005, 09:05 AM
  7. How to define a fixed/unlinked named range?
    By Perspek in forum Excel General
    Replies: 1
    Last Post: 08-02-2005, 06:48 PM

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