+ Reply to Thread
Results 1 to 9 of 9

Formula dependent on cell

  1. #1
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47

    Formula dependent on cell

    Hello all,

    I am back with yet another question.
    This time I am trying to get a cell to obtain a formula depending on another cell...here's the example and my attempt.

    Cell A1... ="FA"
    Please Login or Register  to view this content.
    I want A2 to generate a formula based on the number or characters in cell A1, since this example results in 2 characters, I want to lookup the formula in the table associated to 2. However, this example just returns the value of the cell instead of the formula in the table. Is there a way to return a formula instead? I am manually updating the formulas everytime I need now, but would be tons easier if it was automated.

    Thanks!
    I can post a example spreadsheet if necessary.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    I can post a example spreadsheet if necessary.
    Please do, and explain what you want in context.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47

    Attachment included

    Okay, it may be a bit confusing...
    Instead of having to manually update the formulas in L2:U26, depending on the number of characters in L1:U1, I would like it to automatically reference L36:M39 and use the appropriate formula...

    My attempt in column S:
    Please Login or Register  to view this content.
    I used the evaluate formula feature and noticed the formula stopped at the end of the reference...as in, it will copy the value in the reference cell, but not the formula...

    Any ideas to have it copy the formula?

    Thanks!
    Last edited by asdvender; 12-25-2008 at 11:28 AM. Reason: Removing attachment due to error

  4. #4
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47

    Evaluate formula result

    Here is what the Evaluate Formula feature returns...
    Please Login or Register  to view this content.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    The formula in S2 works fine; it's returning the result #VALUE!, which is exactly what's in the second columns of the lookup table L36:M39.

  6. #6
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47

    More information

    I noticed an error in my last sheet so I am uploading a new one...nothing much changed...my reference sheet was one column off...

    Quote Originally Posted by shg View Post
    The formula in S2 works fine; it's returning the result #VALUE!, which is exactly what's in the second columns of the lookup table L36:M39.
    That is correct, but that is the second column of the reference table's VALUE which was COPIED, I need the FORMULA to be COMPUTED.

    Since T1 is "1245", there are 4 characters. Therefore I would like cells T2:T26 to compute formula M38. If you copy-paste cell M38 into T2:T26 manually, the cells will actually compute the formula, not return the "#VALUE!" result from my attempt.

    My attempt, however returns the VALUE of the reference from the table, I would like it reference the formula.

    The point of L:U is to identify which cells agree from G:K, depending on previous results. So L1:U1 will identify which cells are worth taking a look at. For example, L column is "13", so if G2:I2 (first and third columns) are both v or n, it will put a 1 in column L2, G3:I3 disagree therefore it is blank, and etc...is there an easier way of doing this?

    Thanks!
    Attached Files Attached Files
    Last edited by asdvender; 12-25-2008 at 11:43 AM.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    I can't get my brain around what M36:M39 are trying to compute.

  8. #8
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47
    Quote Originally Posted by shg View Post
    I can't get my brain around what M36:M39 are trying to compute.
    I assigned Columns G:K numbers...
    G=1
    H=2
    I=3
    J=4
    K=5

    M1 says "14"...meaning that when column 1=4 (column G=J) are the same it is correct 4 times and wrong 6 times...
    M2:M26 returns a value of 1 when they agree and returns nothing when they do not.

    Breaking down the formula...
    =IF(INDIRECT(VLOOKUP(VALUE(LEFT(M$1,1)),ref!$D$2:$E$6,2,0))<>"",IF((INDIRECT(VLOOKUP(VALUE(LEFT(M$1,1)),ref!$D$2:$E$6,2,0))=INDIRECT(VLOOKUP(VALUE(RIGHT(M$1,1)),ref!$D$2:$E$6,2,0))),1,""),"")

    The first part of the formula says if M1 is blank, output nothing...otherwise check if column 1=4. If so, return a value of 1, otherwise, return nothing. The reference is to check what column a value of 1 refers to, and same thing for column 4.

    Does that help?

  9. #9
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47
    Any ideas anyone?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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