Excel logical numeric evaluation - excel-formula

So I have a sheet where I am assigning levels to individuals based on their training, IE: Level 4 SME, Level 3 trained and can train others, level 2 trained, and level 1 untrained. For each shift, I want at least 2 level 2 individuals if so readiness is 100% anything above that is over percentage(which is fine) but anything less I want it to be less than 100%. I am trying to do this with formulas but it is not working the way I want.
Table Layout
Formulas
The above example would show more than 100% becuse there is more then two people at level 2 I wish there was a way to loop in excel to allow for me to increment and number for every count of 2.

How about this
=IF(COUNTIF(B2:E2,">=2")>=2,">=100%","not ready")
you can do a certain amount of looping in the UI with the LAMBDA function, if you have Office 365, although I'm not clear as to your requirement.

=COUNTIF(B2:E2,">=2") * 0.5 --> format as percent

Related

Excel - How to split values of 70 items equally into 6 groups

So I'm trying to create an Excel sheet to split the values of 70 items into six groups.
For reference, this is to divide my grandma's estate evenly for her six children. I have approx. 70 items and their appraised values in an Excel sheet, but not sure the best way to go about this. I was hoping to use Solver, but haven't been able to figure it out.
Ideally I could make it so people could pick specific items that they want and run the Excel sheet again to re-balance all the values.
Thanks!
So set this up, based on a thrown together set of values.
Each sumproduct is held to be <= to the (total value / 6)-10. You may want to reduce this to 5 or 2 etc but the smaller you go the harder it is to solve due to the values of the items.
I have done this for 30 items, there is a limit to the number of variables in the Solver - if you hit that then you might consider pairing items, or manually setting some will help, see below.
You might want to add something for sentimental value - I will leave you to consider that.
As for manually setting some items then you can set those items to one, move them to the top or bottom and remove them from the Solver variable cells - that way they won't get changed, but they still need to be included for the value. If the values are similar then they can be taken out if the differences are ignored by the parties.
So, edited the model, see below. Note that 1 item is not allocated. This could be addressed by changing the constraint controlling cells J9:J38 but it comes down to the difficulty of finding an exact solution and that is also why the 10 can be adjusted...

How do I distribute a value over multiple cells evenly but under a maximum limit?

Example data with desired outcome that I need to calculate
I have 12 items of a certain current value. I have a 'soft' cap of $1,000,000 for these values. Some of the items fall above, and some below this cap level.
I have an amount of money (for this example $900,000) that I want to distribute amongst only the items that fall below the cap (in this example 6 items), with the aim of bringing the value of these items up to but not over the cap value.
If I distribute the $900,000 evenly over these 6 items (each receiving $150,000), you can see that items 2 and 9 would then be over the $1,000,000 cap. So items 2 and 9 should only receive $100,000 to raise their value to the cap, then the remaining 4 items would receive and equal share on the remaining pool of money ($700,000 / 4 = $175,000).
So I need a formula to check every item to see if it needs a distribution (i.e below the cap) and then portion/divide out the money pool as illustrated above in the desired distribution column.
Note: The pool of money to be distributed can change. Also the number of items below the cap can change. The cap value itself can change.
I am hoping to avoid VBA or Solver because the spreadsheet could be used on other people's computers.
Hopefully this makes sense. Thanks.
EDIT:
So far I have been able to get close by adding a helper column and using the following formula:
=IF(SUM($F$6:F14)=$D$23,0,E15*MIN(D15,($D$23-SUM($F$6:F14))/SUM(E15:$E$18)))
Working example when values are sorted.
This seems to work when the values are sorted in descending order, as shown in the example image above. But seems to break when the values are a bit more randomly assorted which is likely to happen (as in the original post).
Just to give you an idea of how the solver can be set up to do a capital budget model here is one, also shows the solver and its settings:

Calculating the best combination of coaches for passengers?

I have a table in Microsoft Excel that I'd like to use to calculate the best combination of coaches to house the supplied number of passengers. Here is a simplified version of the table:
I need to enter three formulas in the coach count column that calculates the best value-for-money combination of coaches that can carry all the passengers. For example, if there was 40 passengers, the result should be one 49-seat coach as opposed two 20-seat coaches as it's the cheapest combination.
I have no idea how I would work on implementing these formulas and would appreciate some pointers.
So far, all I have in C4 is
=IF(MOD(B1, A4) = 0, B1 / A4, 0) which only works with multiples of 20 and does not account for combinations of coaches or cost efficiency.
Perhaps this is too complex of a task to implement in formulae? Would I be better off using a VB macro, or simply leaving it to the user to calculate the best combination?
There are two ways to address this problem. I will outline both solutions:
Option 1: In Worksheet Formulas
I'd have to spend more time on this in order to find a really elegant solution for this route, but here's a functional approach that should work well enough. Here are some quick highlights:
Firstly, you need to add a column to your table that outlines the minimum number of seats a coach carries. This helps to facilitate the vlookup.
Secondly, make sure that your lookup table is sorted in ascending order according to the minimum # of seats.
I have made the assumption that the most effective pricing model is to get the majority of people onto the largest coach (or many of the largest coach), and then to use the smallest coach that would accommodate the remaining people. If this is not a fair assumption, then this solution may not be appropriate.
Here are screenshots of the final outcome:
And the formulas required to make it: (and a link in case you need to blow it up: http://i.stack.imgur.com/hKjQK.jpg)
Note: You'll notice that the previous answer is incorrect, as it suggested that 74 people would need to spend $180 instead of $140.
Option 2: Using Excel's Solver Add-In
Enable the solver add-in (File --> Options --> Add-ins --> Excel Add-ins (Manage) --> Solver Add-In)
Configure worksheet as shown:
UI:
The formulas:
On the Ribbon, go to the Data Tab, Analysis Group, & Click Solver.
Configure Solver as follows:
Click "Solve" and then click "Ok"
Final Outcome:
This seems to be a classic linear programming problem. You need to minimize total cost = (number of coach 1 times 50) + (number of coach 2 times 60) + (number of coach 3 times 80), subject to the constraint that (number of coach 1 times 20) + (number of coach 2 times 29) + (number of coach 3 times 49) is greater than or equal to (number of attendees), and all numbers of coaches are greater than or equal to zero. I think Excel's Solver is the tool for such a problem. You don't need to implement any of the solution yourself, you just set it up and Solver handles the algorithmic stuff.
Try this:
Sample calculation
With Formulas showing
The idea is to check for the largest coach first, using the integer value of division Count/Seats. The do the same for the 2nd largest coach with the remaining people. Etc etc.

Microsoft Excel 2007 Always round up even if the decimal is under 0.5

So I'm creating a spreadsheet that determines the cost of materials and the number of each material needed in order to complete a desire project using input from myself. Right now the desired project is a wall that is 250x9 that requires replace all the 4x8 sheets of wood with OSB and install Vinyl Siding. The issue I'm running into is I cannot get it to always round up. By that I mean even if the value is 1.1 it should round up. In this specific case I am buying nails for my nail gun in a box of 2,000 and each sheet of OSB will have 32 nails in it. If 250x9 area requires 70.3125 sheets of OSB it means I still have to buy 71 sheets of OSB. If that OSB is 71 sheets then it require that I have 2272 Nails then the result is I need 1.125 Boxes of nails. However I can't seem to get it to show this as 2 boxes because again I still need to purchase more than one box to complete the project. So with that being said if I take the number of OSB needed 70.3125 and I place it in a formula with a roundup function it still rounds down (gives me a headache that there is a roundup and a rounddown function and it will still round down on me. Perhaps it is the way I am using it in the formula that is incorrect, I'm not sure. So let me translate the formula's used and you can let me know if I'm doing something wrong or if there is a function or set of functions that I can use to solve this issue.
=SUM(((B30*C30)+(B35*C35)+(E30*F30)+(H30*I30))/(E9*G9))
This says that if I added Wall1 L*W with Wall2 L*W with Wall3 L*W with Wall4 L*W and divide it by OSB H*W I get the number of sheets needed. Which in this case is 2250/32 basically. But its programmed in a manner that I can input the information for individual walls to different area's and get it to spit out the total SqFt for each wall and give an individual breakdown per wall of material needed with cost associated per sq ft of material bleh bleh bleh. The point is I take the result that is the 70.3125 and I move it to a different workbook and I say "Sheets OSB Needed" and in that box I have
=ROUNDUP(Sheet1!A9,1)
Whereas I'm asking it to roundup A9 which is the result of the above formula by intervals of 1. But the output is still 70 instead of 71. and much the same case with the nails needed. Which can be calculated in a few different manners but regardless the amount of nails needed divided by 2000 would output the decimal answer which yields a value of less than 1.5 and it too provides me with a value of 1 instead of 2 with much the same formula. I could achieve my desired result I suppose with Trunc and Mod functions collaborating using multiple cells to output the different portions of the data. But is there a way to do this that doesn't involve so many cells being used up?
C7
=Trunc(A9)
Removes Decimal from 70.3125
C8
=MOD(A9)
Outputs decimals from 70.3125
C9
=IF(C8<1,"1",C8)
If Decimals are < a whole number make it a whole number
C3
=SUM(C7+C9)
Add the whole number to the Trunc Number to get value desired.
Which I'm already seeing an issue with this if there is no decimals in the sheets needed then wouldn't it always add one because the decimal place would be 0? How can I handle this issue? Isn't there an easier way to do this or a way to code it so that its all nested into one calculation or at least mostly all into one calculation without making a circular reference of some sort?
You need to change the second parameter to a 0 ROUNDUP(70.3125, 1) is 70.3 the 3 must be getting dropped elsewhere or lost in formatting.
ROUNDUP(70.3125, 0) will give 71.
The second parameter of round up is the decimal place. So to round to integers it should be 0 not 1

How can I implement 'balanced' error spreading functionality in Excel?

I have a requirement in Excel to spread small; i.e. pennies, monetry rounding errors fairly across the members of my club.
The error arises when I deduct money from members; e.g. £30 divided between 21 members is £1.428571... requiring £1.43 to be deducted from each member, totalling £30.03, in order to hit the £30 target.
The approach that I want to take, continuing the above example, is to deduct £1.42 from each member, totalling £29.82, and then deduct the remaining £0.18 using an error spreading technique to randomly take an extra penny from 18 of the 21 members.
This immediately made me think of Reservoir Sampling, and I used the information here: Random selection,
to construct the test Excel spreadsheet here: https://www.dropbox.com/s/snbkldt6e8qkcco/ErrorSpreading.xls, on Dropbox, for you guys to play with...
The problem I have is that each row of this spreadsheet calculates the error distribution indepentently of every other row, and this causes some members to contribute more than their fair share of extra pennies.
What I am looking for is a modification to the Resevoir Sampling technique, or another balanced / 2 dimensional error spreading methodology that I'm not aware of, that will minimise the overall error between members across many 'error spreading' rows.
I think this is one of those challenging problems that has a huge number of other uses, so I'm hoping you geniuses have some good ideas!
Thanks for any insight you can share :)
Will
I found a solution. Not very elegant, through.
You have to use two matrix. In the first you get completely random number, chosen with =RANDOM() and in the second you choose the n greater value
Say that in F30 you have the first
=RANDOM()
cell.
(I have experimented with your sheet.)
Just copy a column of n (in your sheet 8) in column A)
In cell F52 you put:
=IF(RANK(F30,$F30:$Z30)<=$A52, 1, 0)
Until now, if you drag left and down the formulas, you have the same situation that is in your sheet (only less elegant und efficient).
But starting from the second row of random number you could compensate for the penny esbursed.
In cell F31 you put:
=RANDOM()-SUM(F$52:F52)*0.5
(pay attention to the $, each random number should have a correction basated on penny already spent.)
If the $ are ok you should be OK dragging formulas left and down. You could also parametrize the 0.5 and experiment with other values. With 0,5 I have a error factor (the equivalent of your cell AB24) between 1 and 2

Resources