+ Reply to Thread
Results 1 to 7 of 7

Variable Type Mysteries

  1. #1
    Registered User
    Join Date
    12-11-2014
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    94

    Variable Type Mysteries

    Consider the following:
    KYE | KYW | "IF() Formula" | "Test Formula 1" | "Test Formula 2"
    KYE
    KYE
    KYE
    KYW
    KYW
    KYW


    ``BASED ON THIS RETURNING "Yes" from C1:
    =IF(INDIRECT(ADDRESS(ROW(),2))="KYW","Yes","No")


    ``THIS from D1
    =SUMPRODUCT(MAX(($A1:$A7=INDIRECT(ADDRESS(ROW(),2)))*ROW($A1:$A7)))


    ``SHOULD WORK THE SAME AS THIS from E1
    =SUMPRODUCT(MAX(($A1:$A7="KYW")*ROW($A1:$A7)))


    But it doesn't!! The formula in D1 returns #VALUE! and E1 returns the desired response (7). If I take out the INDIRECT() in the first formula, it returns 0. I'm not sure what the right way to do this is, can someone shine some light on the subject? I appreciate any help!


    Copy of Book1.xlsx
    Last edited by npatridge; 01-27-2015 at 07:11 PM.

  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,422

    Re: Variable Type Mysteries

    Your post doesn't make a lot of sense.

    It would probably be clearer, and easier for someone to work on, if you uploaded a sample workbook ... then we don't have to build it for ourselves and guess at what you've done.

    Regards, TMS
    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
    Registered User
    Join Date
    12-11-2014
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    94

    Re: Variable Type Mysteries

    Attachment posted. Thanks!
    Last edited by npatridge; 01-27-2015 at 07:01 PM.

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

    Re: Variable Type Mysteries

    This formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    is not an Array Formula.

    Press F2 and Enter to remove the curly brackets and make it a "normal" formula.

    In fact, none of them are Array Formulae.

    Regards, TMS

  5. #5
    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,422

    Re: Variable Type Mysteries

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  6. #6
    Registered User
    Join Date
    12-11-2014
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    94

    Re: Variable Type Mysteries

    So they are, that was silly. I tried to simplify my table/formula to not confuse things, and I ended up mucking it up!

    So, I'll try not to simplify so much this time. I have this formula that errors out on me:

    =INDEX( $K$1:$O$5, MATCH( 1, ($K$1:$K$5=$A3)* ($L$1:$L$5=$B3)* ($M$1:$M$5= INDIRECT( CONCATENATE( "$",CHAR(COLUMN()+64), (ROW()-(INDIRECT(CONCATENATE("$C$",ROW())))+1), ) ) ), 0 ), MATCH( $F3, $K$1:$O$1, 0 ))

    The Variable Type problem I'm getting seems to happen inconsistently when I F9 my way through the formula. The part that throws it is this:

    (ROW()-(INDIRECT(CONCATENATE("$C$",ROW())))+1)

    When I try to F9 the whole part, it gives me #VALUE!, but if I F9 the innermost parenthesis and work my way out, it works just fine. Any idea what might cause that and how I can fix it? I'm attaching a new spreadsheet to this post. You'll see the problem cells as they return a #N/A.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-11-2014
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    94

    Re: Variable Type Mysteries

    I don't suppose anyone has had any luck on this for me?
    If I have helped you, please add to my reputation!

+ 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. Input box to needs different type of variable type (RC vs. A1?)
    By Niedermee in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-18-2014, 05:00 PM
  2. Mysteries of cell locking/protection
    By ChrisXcel in forum Excel General
    Replies: 9
    Last Post: 04-07-2014, 11:22 PM
  3. Hear to learn VBA mysteries and solve some problems
    By Denison in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-30-2013, 05:51 AM
  4. Variable type
    By arnab0711 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2010, 03:57 AM
  5. What can cause a Variable Type to disappear
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2009, 05:19 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