+ Reply to Thread
Results 1 to 8 of 8

Consolidating multiple functions and columns into a single column

  1. #1
    Registered User
    Join Date
    01-30-2018
    Location
    United States
    MS-Off Ver
    365
    Posts
    7

    Consolidating multiple functions and columns into a single column

    So I'm trying to get this table into four columns. Category, Percent, Monthly Maximum, Total. The Total needs to be able to do all the math that Adjusted through Total does. I have gotten to the Ratio column, but then I run into a snag.

    Just to break it down, Category, Percent, and monthly maximum are manual columns that I have to enter data into. The Adjusted column will display whether the Monthly Maximum or (Percent * Paycheck) is lower. In the Leftover column, the (Percent * paycheck) - Monthly Maximum is calculated if Monthly Maximum is exceeded. In the numerator column, a category will be 0% if it has exceeded the Monthly Maximum, otherwise, the Percent column value is carried over. Then the values of the Numerator column are added up giving the denominator (not a column). The ratio is calculated based on the Numerator column divided by the Denominator value (or the sum of the Numerator Column). In order to make this calculated part into a single column, I need to find a way to not use the Total row at the very bottom. I have tried using sumif and sumifs functions but I keep running into problems.
    Attached Files Attached Files

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Consolidating multiple functions and columns into a single column

    =IF([@[Monthly Maximum]]=0,[@Percent]*$B$1,[@[Monthly Maximum]])+IF([@[Monthly Maximum]]=0,($B$1*SUMPRODUCT([Percent]*([Monthly Maximum]>0))-$D$1)*[@Percent]/SUMPRODUCT([Percent]*([Monthly Maximum]=0)),)
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-30-2018
    Location
    United States
    MS-Off Ver
    365
    Posts
    7

    Re: Consolidating multiple functions and columns into a single column

    So this is close to what I need. It appears that when the monthly maximums add up to larger than the paycheck, categories without maximums go negative. I would still like each category to have funds distributed evenly. This is great tho, and definitely a step in the right direction. I’m going to look over it a little more.

  4. #4
    Registered User
    Join Date
    01-30-2018
    Location
    United States
    MS-Off Ver
    365
    Posts
    7

    Re: Consolidating multiple functions and columns into a single column

    I've determined that the equation I needed was

    {=(IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4)))+((IF([@[Monthly Maximum]]=0,[@Percent],IF(IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4))>=[@[Monthly Maximum]],0,[@Percent])))/(SUMPRODUCT([Percent]*([Monthly Maximum]>[Percent]*$C$4))+SUMPRODUCT([Percent]*([Monthly Maximum]=0)))*(SUMPRODUCT((([Percent]*$C$4)-[Monthly Maximum])*(([Percent]*$C$4>[Monthly Maximum])*([Monthly Maximum]>0)))))}.

    On top of this, I have noticed another problem. A total still has the potential of exceeding its maximum. When a paycheck is distributed and the portion of a category is under the max the leftovers can push the total over the maximum. For this, I created the following.

    {=(IF([@[Monthly Maximum]]=0,((IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4)))+((IF([@[Monthly Maximum]]=0,[@Percent],IF(IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4))>=[@[Monthly Maximum]],0,[@Percent])))/(SUMPRODUCT([Percent]*([Monthly Maximum]>[Percent]*$C$4))+SUMPRODUCT([Percent]*([Monthly Maximum]=0)))*(SUMPRODUCT((([Percent]*$C$4)-[Monthly Maximum])*(([Percent]*$C$4>[Monthly Maximum])*([Monthly Maximum]>0)))))),IF(((IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4)))+((IF([@[Monthly Maximum]]=0,[@Percent],IF(IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4))>=[@[Monthly Maximum]],0,[@Percent])))/(SUMPRODUCT([Percent]*([Monthly Maximum]>[Percent]*$C$4))+SUMPRODUCT([Percent]*([Monthly Maximum]=0)))*(SUMPRODUCT((([Percent]*$C$4)-[Monthly Maximum])*(([Percent]*$C$4>[Monthly Maximum])*([Monthly Maximum]>0))))))>=[@[Monthly Maximum]],[@[Monthly Maximum]],((IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4)))+((IF([@[Monthly Maximum]]=0,[@Percent],IF(IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4))>=[@[Monthly Maximum]],0,[@Percent])))/(SUMPRODUCT([Percent]*([Monthly Maximum]>[Percent]*$C$4))+SUMPRODUCT([Percent]*([Monthly Maximum]=0)))*(SUMPRODUCT((([Percent]*$C$4)-[Monthly Maximum])*(([Percent]*$C$4>[Monthly Maximum])*([Monthly Maximum]>0)))))))))+((IF([@[Monthly Maximum]]=0,[@Percent],IF(IF([@[Monthly Maximum]]=0,((IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4)))+((IF([@[Monthly Maximum]]=0,[@Percent],IF(IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4))>=[@[Monthly Maximum]],0,[@Percent])))/(SUMPRODUCT([Percent]*([Monthly Maximum]>[Percent]*$C$4))+SUMPRODUCT([Percent]*([Monthly Maximum]=0)))*(SUMPRODUCT((([Percent]*$C$4)-[Monthly Maximum])*(([Percent]*$C$4>[Monthly Maximum])*([Monthly Maximum]>0)))))),IF(((IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4)))+((IF([@[Monthly Maximum]]=0,[@Percent],IF(IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4))>=[@[Monthly Maximum]],0,[@Percent])))/(SUMPRODUCT([Percent]*([Monthly Maximum]>[Percent]*$C$4))+SUMPRODUCT([Percent]*([Monthly Maximum]=0)))*(SUMPRODUCT((([Percent]*$C$4)-[Monthly Maximum])*(([Percent]*$C$4>[Monthly Maximum])*([Monthly Maximum]>0))))))>=[@[Monthly Maximum]],[@[Monthly Maximum]],((IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4)))+((IF([@[Monthly Maximum]]=0,[@Percent],IF(IF([@[Monthly Maximum]]=0,[@Percent]*$C$4,IF([@Percent]*$C$4>=[@[Monthly Maximum]],[@[Monthly Maximum]],[@Percent]*$C$4))>=[@[Monthly Maximum]],0,[@Percent])))/(SUMPRODUCT([Percent]*([Monthly Maximum]>[Percent]*$C$4))+SUMPRODUCT([Percent]*([Monthly Maximum]=0)))*(SUMPRODUCT((([Percent]*$C$4)-[Monthly Maximum])*(([Percent]*$C$4>[Monthly Maximum])*([Monthly Maximum]>0))))))))>=[@[Monthly Maximum]],0,[@Percent])))/(SUMPRODUCT([Percent]*([Monthly Maximum]>((IF([Monthly Maximum]=0,[Percent]*$C$4,IF([Percent]*$C$4>=[Monthly Maximum],[Monthly Maximum],[Percent]*$C$4)))+((IF([Monthly Maximum]=0,[Percent],IF(IF([Monthly Maximum]=0,[Percent]*$C$4,IF([Percent]*$C$4>=[Monthly Maximum],[Monthly Maximum],[Percent]*$C$4))>=[Monthly Maximum],0,[Percent])))/(SUMPRODUCT([Percent]*([Monthly Maximum]>[Percent]*$C$4))+SUMPRODUCT([Percent]*([Monthly Maximum]=0)))*(SUMPRODUCT((([Percent]*$C$4)-[Monthly Maximum])*(([Percent]*$C$4>[Monthly Maximum])*([Monthly Maximum]>0))))))))+SUMPRODUCT([Percent]*([Monthly Maximum]=0))))*(SUMPRODUCT(((IF([Monthly Maximum]=0,[Percent]*$C$4,IF([Percent]*$C$4>=[Monthly Maximum],[Monthly Maximum],[Percent]*$C$4)))+((IF([Monthly Maximum]=0,[Percent],IF(IF([Monthly Maximum]=0,[Percent]*$C$4,IF([Percent]*$C$4>=[Monthly Maximum],[Monthly Maximum],[Percent]*$C$4))>=[Monthly Maximum],0,[Percent])))/(SUMPRODUCT([Percent]*([Monthly Maximum]>[Percent]*$C$4))+SUMPRODUCT([Percent]*([Monthly Maximum]=0)))*(SUMPRODUCT((([Percent]*$C$4)-[Monthly Maximum])*(([Percent]*$C$4>[Monthly Maximum])*([Monthly Maximum]>0)))))-[Monthly Maximum])*((IF([Monthly Maximum]=0,[Percent]*$C$4,IF([Percent]*$C$4>=[Monthly Maximum],[Monthly Maximum],[Percent]*$C$4)))+((IF([Monthly Maximum]=0,[Percent],IF(IF([Monthly Maximum]=0,[Percent]*$C$4,IF([Percent]*$C$4>=[Monthly Maximum],[Monthly Maximum],[Percent]*$C$4))>=[Monthly Maximum],0,[Percent])))/(SUMPRODUCT([Percent]*([Monthly Maximum]>[Percent]*$C$4))+SUMPRODUCT([Percent]*([Monthly Maximum]=0)))*(SUMPRODUCT((([Percent]*$C$4)-[Monthly Maximum])*(([Percent]*$C$4>[Monthly Maximum])*([Monthly Maximum]>0)))))>[Monthly Maximum])*([Monthly Maximum]>0)))}

    This equation essentially takes the leftovers and redistributes to the appropriate categories that have not exceed the maximums. I've determined that this kind of equation must be run a maximum of times that there are categories in the budget. Unfortunately, I have hit the character limit. Does anyone know an easier way to write this equation, or an easier way to complete this process?
    Another quick thing to throw out there is, is there a way to run an equation as many times as the results of a count() funtion? Like count(category) would then run the equation for how many categories, ensuring that the leftovers were distributed evenly to all the categories are discribed?
    Thanks for the help guys!

  5. #5
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Consolidating multiple functions and columns into a single column

    changed formulas in D1 and in column total new
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-30-2018
    Location
    United States
    MS-Off Ver
    365
    Posts
    7

    Re: Consolidating multiple functions and columns into a single column

    It looks like what you created does most of it but when some categories have hit their max, it stops others that have not hit their max from receiving any funds from the leftovers. This leads to funds not distributed completely proportionately which I definitely need.

  7. #7
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Consolidating multiple functions and columns into a single column

    D1 =SUM(IF(_t[Monthly Maximum]>_t[Percent]*B1,,_t[Monthly Maximum])) as array f

  8. #8
    Registered User
    Join Date
    01-30-2018
    Location
    United States
    MS-Off Ver
    365
    Posts
    7

    Re: Consolidating multiple functions and columns into a single column

    That equation does not create the same results as the equation I posted earlier, though, when some categories maximums have been met and others have not. Compare the total new column to the total equation column. In sheet1, the paycheck exceeds what is needed to fulfill each categories' maximum so the total new (your equation) and the total equation (my equation) match up. However, as in sheet2, when the paycheck does not provide enough to fulfill the maximums, the total new column does not equal the total equation column. Your column does not distribute leftovers among categories that have yet to hit their maximum. My equation does do this. Can my equation be simplified any further without changing the results?
    Thanks
    Attached Files Attached Files

+ 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. consolidating multiple worksheets in single sheet of the same workbook
    By anwitha in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-09-2017, 11:14 AM
  2. Multiple columns to a single column
    By RhettWS in forum Excel General
    Replies: 5
    Last Post: 02-06-2015, 03:38 PM
  3. Replies: 4
    Last Post: 04-16-2014, 03:12 AM
  4. Replies: 0
    Last Post: 10-24-2013, 05:04 AM
  5. Single Column to Multiple Columns
    By hscmsf in forum Excel General
    Replies: 1
    Last Post: 02-08-2012, 02:38 PM
  6. Replies: 1
    Last Post: 03-26-2010, 11:18 AM
  7. Consolidating multiple rows of data into single row
    By fredenbp4 in forum Excel General
    Replies: 3
    Last Post: 11-05-2009, 01:14 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