+ Reply to Thread
Results 1 to 3 of 3

Array Range Depends on Value in Each Cell-input an array

  1. #1
    Registered User
    Join Date
    04-01-2010
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    Array Range Depends on Value in Each Cell-input an array

    I am trying to input an array that differs in size depending on value/type of each cell. For example I have the following scenario:


    ______Column A
    Row1 _____1
    Row2_____cat
    Row3_____dog
    Row4______1

    In this example I want the array to only include the rows in Column A that have text, not numbers (i.e. A2:A3). However, the value/type in each cell can change (e.g. A1 could become a text), in which case I need the array range to change (e.g. range would change to A1:A3). Basically I want to loop through the column and only return a range of text only. I have very basic skill in VBA and was hoping I could do this with excel's formulas. Any ideas of how I can do this?
    Last edited by Neale; 04-01-2010 at 03:11 PM.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    re: Array Range Depends on Value in Each Cell-input an array

    Hi and welcome to the forum
    Actully it can be done with an array formulae. But it is not clear what the result look like....
    Do you want do return address of text entries like A2 and A3 ????
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Registered User
    Join Date
    04-01-2010
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    re: Array Range Depends on Value in Each Cell-input an array

    Thanks for the quick response. I am actually trying to do a summation in Column B depending on what is in Column A. For example:


    ______Column A _____ColumnB
    Row1 _____1 _____=SUM(B2:B3)
    Row2_____cat _____10
    Row3_____dog _____15
    Row4______1 _____=SUM(B4:B7)
    Row5_____cat _____10
    Row6_____dog _____15
    Row7_____dog _____15

    The rows that will have the summation will depend on whether or not the values in column A are text or numbers. But as mentioned in previous post, values in Column A can change. For example, A4 could become "dog", and A5 could become 1. I'd then want B1 to sum B2:B4 and likewise B5 to sum B6:B7. What I need is to develop an equation that will allow for this change to happen.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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