+ Reply to Thread
Results 1 to 6 of 6

only choose cells with data

Hybrid View

  1. #1
    Registered User
    Join Date
    09-23-2014
    Location
    Washington, DC
    MS-Off Ver
    2011
    Posts
    92

    only choose cells with data

    Hi y'all,

    How do I write a formula that chooses only the cells with data in them? I know you can use =count() to return the number of cells with data, but is there a way to choose the whole array? The number of data points in each array also varies, so the formula would have to be flexible in that way.

    Thanks,

    Alex

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: only choose cells with data

    What exactly is this formula doing with these chosen cells?
    For example, If you =Average(A1:A50), it will ignore empty cells and cells with text and only "choose" cells with numbers in them
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    09-23-2014
    Location
    Washington, DC
    MS-Off Ver
    2011
    Posts
    92

    Re: only choose cells with data

    I'm using it with the linest function, which doesn't act in the same way as the average function. It returns errors if cells don't have values.

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: only choose cells with data

    Hi All,

    an attempt: in linest function instead of

    =LINEST(A1:A100...


    =LINEST(A1:INDEX(A1:A100,COUNT(A1:A100)),...


    Hope it helps


    Edit: COUNT (wrong traduction from my Italian settings)
    Last edited by canapone; 10-01-2014 at 10:15 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: only choose cells with data

    There should be a direct way but I don't know it. What I would do is use formulas to make the x's and y's congruous.
    See the attached.
    In A and B is the original data.
    In G and H is the joined data using Array Functions
    Then I use Dynamic Defined names to select only G1:G18 (Formula's tab>Name Manager)
    I can explain it more fully if you need and if this fits your needs.
    Attached Files Attached Files

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: only choose cells with data

    Hi.

    You could use an array formula**:

    =LINEST(INDEX(A1:A10,N(IF(1,SMALL(IF(ISNUMBER(A1:A10),ROW(A1:A10)-MIN(ROW(A1:A10))+1),ROW(INDIRECT("1:"&COUNT(A1:A10))))))))

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

+ 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] Choose Specific Cells Instead of Row
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2013, 06:29 PM
  2. [SOLVED] Formula help to choose lowest cost from multiple vendors and then choose vendor
    By roland_arv in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-27-2013, 07:48 PM
  3. Formula: Drop Down List -> Choose Option Finds Cells & Replace Cells with Cells
    By g00glethis1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2010, 01:10 PM
  4. How do I use VBA to choose the source cells for a list with Data Validation?
    By baconcow in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-11-2008, 05:36 PM
  5. choose value from multiple cells
    By Beermonster in forum Excel General
    Replies: 3
    Last Post: 01-30-2008, 10: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