+ Reply to Thread
Results 1 to 5 of 5

Need 'COPY_VALUE_TO' formula to add to an IF OR calculation - after googling I'm worried

  1. #1
    Registered User
    Join Date
    12-21-2013
    Location
    France
    MS-Off Ver
    Excel 2007
    Posts
    28

    Question Need 'COPY_VALUE_TO' formula to add to an IF OR calculation - after googling I'm worried

    Has Microsoft given us a 'COPY_VALUE_TO' function?
    I can't find it (please excuse me, we all have bad days), but I'm not alone.
    Googling this problem is a classic nightmare of dead ends for all the poor sods out there that have tried their best to formulate this question.
    I've spent an entire evening reading responses that never answered the OP's question.

    As a result, I'm just hoping I've done a good enough job on formulating my question.
    I'm also thinking about the tags, because this is a question that needs answering.
    If the solution can be found, hopefully the tags and the title will help everybody that follows.
    Here's the problem:

    A Calculation Utility - enter basic data to gain (at least) a two column output
    Column 1: 1 - 100 (%)
    Column 2: Value per increment

    The 100 row sheet has 3 different calculation formulas, that function according to IF OR.
    On 'condition met', the final value of the previous phase (around row 36) must(?) be saved to an absolute reference cell.
    This so it can be used in the next calculation phase.

    Contents of AF (output column)
    Current state - this clearly doesn't work, but highlights the problem.

    AF35=IF(OR(R35<0),((S35*U35)+AF34),(AB35-(AD35*R35)))
    AF36=IF(OR(R36<0),((S36*U36)+AF35),(AB36-(AD36*R36))) Final value
    AF37=IF(OR(R37<0),((S37*U37)+AF36),(AB37-(AD37*R37))) Condition met - Correct (adds AF36 value)
    AF38=IF(OR(R38<0),((S38*U38)+AF37),(AB38-(AD38*R38))) Condition met - Incorrect (adds AF37 value)

    Here is a lovely solution, if the 'COPY VALUE TO' function exists
    Using a single repository cell $ZZ$1.

    AF35=IF(OR(R35<0),((S35*U35)+$ZZ$1),((AB35-(AD35*R35))COPY_VALUE_TO $ZZ$1))
    AF36=IF(OR(R36<0),((S36*U36)+$ZZ$1),((AB36-(AD36*R36))COPY_VALUE_TO $ZZ$1))
    AF37=IF(OR(R37<0),((S37*U37)+$ZZ$1),((AB37-(AD37*R37))COPY_VALUE_TO $ZZ$1)) condition met - Correct (adds AF36 value)
    AF38=IF(OR(R38<0),((S38*U38)+$ZZ$1),((AB38-(AD38*R38))COPY_VALUE_TO $ZZ$1)) condition met - Correct (adds AF36 value)

    Something like this would ensure that the final value in ZZ1 would be always be that of AF36.
    It would also ensure that the AF column would advance incrementally at whatever point the calculation changeover occurs.

    If this is a neat way of solving this problem, does anybody know a neat way of writing:
    ((AB37-(AD37*R37))COPY VALUE TO $ZZ$1))

    There will be 'one more' similar change around row 75, but primarily I'd like to see how this problem can be fundamentally solved, to provide a definitive solution, both for me, and for everybody else that follows.
    We'll deal with any complex nesting required when I've figured out how the 3rd and final set of calculations need to function.

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

    Re: Need 'COPY_VALUE_TO' formula to add to an IF OR calculation - after googling I'm worri

    Hi and welcome to the forum

    Short answer - no, there is no regular formula or function that will "push" data to another cell. All excel formulas "pull" in data and do their thing in the cell they reside.

    To do what you want, you would put the formula IN ZZ1 to go and get the answer - but, as soon as the data changes, so will the answer.

    A formum member can probably put some VBA code together for you for this,
    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
    12-21-2013
    Location
    France
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Need 'COPY_VALUE_TO' formula to add to an IF OR calculation - after googling I'm worri

    Thanks for that very clear response.
    I was rather hoping to avoid getting embroiled in scripting at this stage, but perhaps it's unavoidable.

    I'm going to first look at adding more columns
    At least my thinking can now be concentrated on what is possible.

    In the meantime I'll be alert to any suggestions made here

  4. #4
    Registered User
    Join Date
    12-21-2013
    Location
    France
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Need 'COPY_VALUE_TO' formula to add to an IF OR calculation - after googling I'm worri

    Okay...... I've figured out how to do it.
    In fact within about 5 minutes of reading FDibbins clarification post, I had figured out the correct path to follow.
    The fog had been blown away.

    To effectively fix the result in a cell in a column range "when a condition is met"....

    1. Set 'when condition met' = 0
    eg.
    AF=IF(OR(R39<0),0,(AB39-(AD39*R39)))

    2. Run 2nd phase calculation in adjacent AG column

    AG=IF(OR(R39<0),(S39*U39)+MAX($AF$1:AF39),MAX($AF$1:AF39))

    Note: 'MAX' finds the highest number in the ascending relative AF range.

    AG always displays its adjacent AF value (1st phase calculation) until condition is met.
    At which point AG displays the value of the 2nd phase calculation + the highest value of phase 1.

    Simple.... almost beautiful no? (have I made a mistake?)

    This seems to produce a perfect transition at whatever row the condition is met.

    If this is correct.... it will not solve all of the 'COPY_TO' needs, but it may provide a possible methodology for many, as very often highest or lowest values in a range are required to be isolated.

    Nice!


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

    Re: Need 'COPY_VALUE_TO' formula to add to an IF OR calculation - after googling I'm worri

    Great solution!! Thanks for the kind words and feedback

+ 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. How to read formula result for calculation of another formula?
    By Shad0wguy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-02-2013, 02:15 PM
  2. excel formula calculation - how to insert the right formula
    By Manila.Boracay in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-17-2011, 04:21 AM
  3. i need help with a calculation formula...
    By moegecko in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 09:05 PM
  4. [SOLVED] Re: base formula calculation on whether different cell has formula
    By Bill Kuunders in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2005, 05:05 PM
  5. [SOLVED] base formula calculation on whether different cell has formula
    By rcmodelr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2005, 08:05 PM

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