+ Reply to Thread
Results 1 to 5 of 5

Retrieving the results of a formula to use in another formula

  1. #1
    Registered User
    Join Date
    09-26-2014
    Location
    Southeastern US
    MS-Off Ver
    07/10
    Posts
    3

    Retrieving the results of a formula to use in another formula

    I am trying to write code that will compare two columns in one worksheet and display the results in a single cell of another worksheet. The columns contain either a 1 or null in each cell, and I am multiplying the cells from each column in each row, then building a running sum of these products. The code works fine, until I reach a column where I've used an IF statement to determine 1 or null for each row (I'm comparing ballerina's roles with the possible combinations of rehearsals to identify personnel schedule conflicts). When I get to columns where each cell has a formula determining the value of the cell, my code crashes. Can anyone tell me how to access the value generated by the formula in the original columns for use in my comparison algorithm?

    Thanks in advance.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Retrieving the results of a formula to use in another formula

    Hi, welcome to the forum

    A formula should not affect the results of your calc. What is the formula you are using? I have a feeling if says something like...=IF(test,"1","0")

    If indeed you have "" around 0 and 1, remove them, they are forcing the numbers to be text

    On a side note, have you considered using SUMPRODUCT() for this instead of VBA?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-26-2014
    Location
    Southeastern US
    MS-Off Ver
    07/10
    Posts
    3

    Re: Retrieving the results of a formula to use in another formula

    Thanks Ford. That solved the problem. I had tried changing the "value if false", or else piece from "" to 0 before. This time it worked. I'm using VBA to develop a scheduling app that our local community ballet can use to schedule rehearsals for the annual Nutcracker performance. This piece of the app builds a matrix that identifies rehearsal combinations that include the same dancers. I want to learn VBA, so this is my first project. Therefore, I may be doing things the hard way, but I don't know the details of the Excel built in functions, and I'm learning a ton by fire. Thanks for the suggestion on the function. I'll look into it and see if it is a fit for my grand scheme.

    Luke

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Retrieving the results of a formula to use in another formula

    Happy to help, that is actually a fairly common error

    If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

  5. #5
    Registered User
    Join Date
    09-26-2014
    Location
    Southeastern US
    MS-Off Ver
    07/10
    Posts
    3

    Re: Retrieving the results of a formula to use in another formula

    I found the star piece. However, Thread Tools doesn't seem to have an option to label the thread SOLVED. Can you help me out on this?...never mind. Just found it.

+ 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. Retrieving Data Using IF and INDEX Formula
    By mack_76 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-20-2014, 11:19 AM
  2. retrieving a formula from a table
    By BradPhillips in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-11-2014, 04:49 AM
  3. [SOLVED] Retrieving cell value for VBA formula
    By The Phil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-26-2013, 05:52 PM
  4. Replies: 3
    Last Post: 06-19-2013, 03:40 AM
  5. Retrieving Top 3 Results
    By k992010 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-21-2013, 06:46 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