+ Reply to Thread
Results 1 to 8 of 8

Calculate Figure Based off 3 Values : Complex Formula?

Hybrid View

Rimberaud Calculate Figure Based off 3... 10-05-2014, 04:41 AM
karedog Re: Calculate Figure Based... 10-05-2014, 05:00 AM
Rimberaud Re: Calculate Figure Based... 10-05-2014, 05:05 AM
Richard Buttrey Re: Calculate Figure Based... 10-05-2014, 06:19 AM
Rimberaud Re: Calculate Figure Based... 10-05-2014, 07:30 AM
karedog Re: Calculate Figure Based... 10-05-2014, 12:09 PM
Rimberaud Re: Calculate Figure Based... 10-06-2014, 03:57 PM
karedog Re: Calculate Figure Based... 10-07-2014, 06:48 AM
  1. #1
    Registered User
    Join Date
    03-08-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Calculate Figure Based off 3 Values : Complex Formula?

    Good morning!

    I'm trying to create a formula using 3 values. All of the values are between 1 and 100. For the purposes of this we'll call the values E, I and A and the value we want to calculate C. I'm trying to write a "simple" formula to do this, but I'm struggling a bit. The logic for the result is:

    C= (Ix8)+(Ax4)
    C= round (C/4)

    If (C<250) then C=round ((C/250)x100)
    If (C>250) then C=round ((250/C)x100)
    If (C=250) then C= 100

    If (E<11) then C=round (C-(C/10))
    If (E<21) then C=round (C-(C/10))
    If (E<31) then C=round (C-(C/10))

    I'm sure the logic in this calculation can be simplified, and the E<11/E<21/E<31 calculation is performed 3 times, so if the value of E is 5 then it's less than 11, less than 21 and less than 31 so is subjected to 3 calcuations of C=round (C-(C/10)).

    Sorry for a smelly one on a Sunday morning!
    Last edited by Rimberaud; 10-05-2014 at 06:42 AM.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Calculate Figure Based off 3 Values : Complex Formula?

    Hi,

    Since E<11, E<21, E<31, all of them refer to same thing, that is C=round (C-(C/10)), so you can simply discard these two lines :
    If (E<11) then C=round (C-(C/10))
    If (E<21) then C=round (C-(C/10))

    You only need the latest line :
    If (E<31) then C=round (C-(C/10))

    Because (E<11) is covered in (E<31), so the (E<21).
    Don't you think so ?
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Registered User
    Join Date
    03-08-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Calculate Figure Based off 3 Values : Complex Formula?

    Thank you for replying. I initially thought that, but it's a check you do 3 times.

    If E<31 then you calculate C=round (C-(C/10))
    If E<21 then you take the value created in the line above and perform the calculation again.
    If E<11 then you take the value created in the line above and perform the calculation again.

    So a value of 21-31 would be subject to one adjustment down, a value of 11-20 would be subject to the reduction twice and less than 11 it would be a third time.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculate Figure Based off 3 Values : Complex Formula?

    Hi,

    I find this confusing, Not because I don't understand the formulae you show but because you seem to be implying a circular reference in C i.e. C=Round(C-C/10).
    If that is indeed the case then you'll probably need a macro.

    However upload a workbook and manually enter the results you expect to see for various initial data values. Tell us which cells are data and which are results.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    03-08-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Calculate Figure Based off 3 Values : Complex Formula?

    Thanks Richard. Fully understand. Each statement should be processed in turn. So if the statement is C=Round(C-C/10) then you should take the value C you have calculated fro the above statement and then basically remove 10% from it.

    What I've done is attached a file containing how things should work.

    Columns A/B/C are the inputs E/I/A. Column D is the value of C I should expect to see.

    Column E is the result of
    C= (Ix8)+(Ax4)
    Column F is the result of column E with this applied:
    round (C/4)
    Column G is the result of Column F with this applied:
    If (C<250) then C=round ((C/250)x100)
    If (C>250) then C=round ((250/C)x100)
    If (C=250) then C= 100
    Columns H, I and J perform the calculation of removing 10% depending on the value of E. J is the final figure I am calculating.
    If (E<11) then C=round (C-(C/10))
    If (E<21) then C=round (C-(C/10))
    If (E<31) then C=round (C-(C/10))
    So I can do the calculation if I do it in stages, but not by writing a single formula. Maybe that is how I will have to do it?

    It should be noted for the purposes of this exercise I am using the ROUND function and not the Bankers Rounding function(which is slightly different) I am using in my master spreadsheet hence the slight differences in the rounding.

    Book1.xlsx

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Calculate Figure Based off 3 Values : Complex Formula?

    This is the single cell formula (put on anywhere on row 2 outside data range) :

    =ROUND((ROUND(((B2*8)+(C2*4))/4,0)/250)^SIGN(250-ROUND(((B2*8)+(C2*4))/4,0))*100,0)*0.9^LOOKUP(A2,{0,3;11,2;21,1})


    Steps to reproduce this formula :


    E2 =(B2*8)+(C2*4)


    F2 =ROUND(E2/4,0)
    F2 =ROUND(((B2*8)+(C2*4))/4,0)


    Your if() function in G2 can be replaced to non if() formula like this :
    G2 =ROUND((F2/250)^SIGN(250-F2)*100,0)
    G2 =ROUND((ROUND(((B2*8)+(C2*4))/4,0)/250)^SIGN(250-ROUND(((B2*8)+(C2*4))/4,0))*100,0)


    Then you need to subtract by 10% several times based on how often the value of A2 less than some conditional values. A number, subtracted by 10% is equal to 90% the number, in other words =number * 0.9

    If A2 < 11 --> one time subtraction --> Number * 0.9 = Number * 0.9^1
    If A2 < 21 --> two times subtraction --> (Number * 0.9) * 0.9 = Number * 0.9^2
    If A2 < 31 --> three times subtraction --> ((Number * 0.9) * 0.9) * 0.9 = Number * 0.9^3

    so it can be simplified as Number * 0.9^occurence

    To find occurence, use lookup() function like this :
    =LOOKUP(A2,{0,3;11,2;21,1})


    So the final formula :
    =G2 * 0.9 ^ occurence
    =ROUND((ROUND(((B2*8)+(C2*4))/4,0)/250)^SIGN(250-ROUND(((B2*8)+(C2*4))/4,0))*100,0)*0.9^LOOKUP(A2,{0,3;11,2;21,1})

  7. #7
    Registered User
    Join Date
    03-08-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Calculate Figure Based off 3 Values : Complex Formula?

    Fantastic. A million thank yous, I don't think I'd have got there on my own.

  8. #8
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Calculate Figure Based off 3 Values : Complex Formula?

    Glad I can help

+ 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. Calculate One Value Based on a Formula for Three Other Values
    By SpeakingPeace in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2014, 07:14 PM
  2. Complex formula to calculate hrs per month
    By maggi259 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-30-2014, 08:13 AM
  3. Complex Excel Formula Required for Obtaining Values based on Column & Row
    By adeel726 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-05-2013, 04:36 PM
  4. [SOLVED] Multiple Condition Formula to calculate a final figure
    By Graham Taylor in forum Excel General
    Replies: 9
    Last Post: 07-12-2012, 07:46 AM
  5. Calculate new figure based upon % reduction table
    By halfpint123 in forum Excel General
    Replies: 4
    Last Post: 06-14-2012, 09:08 AM

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