I want to distribute a value over a column of cells in multiples of 0.25. For instance, if my value is 6 and my column consists of 10 cells, I want 6 of the cells to have a value of 0.5 and 4 of the cells to have a value of 0.75 to sum to 6.
Another example would be if the value was 1 and I wanted to distribute that over the same column of 10 cells. 4 of the cells should have a value of 0.25 and 6 should have a value of 0.
The unequal cells could either be the first 4 in the column or randomly selected from the 10.
This solution requires the following:
Range to enter variables located at B3:C6 (see fig. 1)
Number: Number to be distributed. Enter 6 in C3
Divider: Enter 0.25 in C4
Parts: Number of parts to distribute. Enter 10 in C5
Multiples: Formula to calculate & validate the parts to be allocated. Enter this formula in C6
=IF( MOD( $C$3 , $C$4 ) <> 0 , "!Err" , $C$3 / $C$4 )
Range to calculate the distribution located at E2:G13 (see fig. 1)
Parts: Keeps the relationship between distribution and part number. Enter this formula in E3 then copy till last record
=SUM( 1 , E2 )
Times: Number of times each part number contains the multiple. Enter this formula in F3 then copy till last record
=SUM( INT( $C$6 / $C$5 ) , IF( $E3 <= MOD( $C$6 , $C$5 ) , 1 , 0 ) )
Distribution: Resulting distribution. Enter this formula in G3 then copy till last record
= $C$4 * $F3
Total: validation of the distribution. Enter this formula in E3 then copy till last record
=IF( ROUND( SUM( $G$3:$G$12 , -$C$3 ) , 2 ) <> 0 , "!Err" , $C$3 )
Fig. 1
Fig. 2
Related
In an excel spreadsheet I have data that looks like:
Basically column A has the dates from the beginning of the year to the end of the year then Column B I manually enter values every Monday-Friday, Column C to get -2.3% I used the formula "=(C2727-C2726)/C2726" where 2727 and 2726 have the values 134,655 and 137,849 respectively. Then lastly column D has the days of the week.
The problem I have is that my current formula I have to enter every day because Monday and Tuesday get messed up because Saturday and Sunday are always blanks. So what I would like is a dynamic formula that does the same thing but for Monday it does "(Monday-Friday)/Monday" and Tuesday it does "=(Tuesday-Monday)/Monday"
Any help is appreciated
You could do in Column C:
= CHOOSE( MIN( 3, MOD( WEEKDAY( A5 ) - 1, 6 ) + 1),
"",
( B2-B5 ) / B2,
( B5-B4 ) / B5
)
and copy it down, where Column B contains your values and Column A contains your dates.
Note, however, that you will need to handle the first cell that ends up referencing your titles or start of data. Look at cell B4 in the above example: it errors out because it tries to calculate with B1 which contains a title. You may want to wrap this in an IFERROR:
= IFERROR( CHOOSE( MIN( 3, MOD( WEEKDAY( A4 ) - 1, 6 ) + 1),
"",
( B1-B4 ) / B1,
( B4-B3 ) / B4
),
"n/a" )
Doing some volunteer work for a non-profit, I recently had a problem that I couldn't easily figure out:
I had a dollar total of funds pledged for the year ($150,000), and I knew the total number of pledges (90), and I wanted to see what it would look like if the pledges were distributed evenly from zero to X until the amount had been reached with each increment being the same.
So, for instance if we had $15 raised among 5 pledgers, the even distribution would be 1,2,3,4,5. And I wanted to do it in all in excel, because small non-profit.
Using your provided data setup (Number of backers in cell A1, total pledged amount in cell A2), use this formula in cell C1 and copy down:
=ROW()*$A$2/((1+$A$1)*$A$1/2)
Note that this formula will give you different results than your original. However, it will provide correct results, just as yours does.
This is easy using Solver, we will put the 90 pledges in A1 through A90 and the increment in B1. Lets guess that the increment is 1 so we put that in B1.
in A1 we enter: 1In A2 we enter the formula:
=A1+$B$1
and copy down through A90In A91 we enter:
=SUM(A1:A90)
Clearly this is way off from the desired 150,000We can use Solver to adjust the value in B1 to get the desired result in A91:
The value Solver gets in B1 is 37.4307116107366We naturally would round this to two digits to get a good approximate solution
In a spreadsheet enter as A1 the number of "steps" in my case, pledgers as cell A1. In A2 enter the total you hope to reach. In my example $150,000. Finally in C1 enter the following formula:
= 2 *( ( (-1 * (2 * $A$1 * (ROW()) )) + ( 4 * (ROW()) * $A$2 ) + POWER( $A$1, 2 ) + $A$1 - ( 2 * $A$2 ))/( POWER( 2 * $A$1, 2 ) ) )
And then drag that column down the number of rows equal to your number of steps in A1. If you tally those values, it should equal the value in A2.
You'll notice that I use the ROW() function - if you'd like to start this on row other than row 1, you'll need to adjust the two calls to ROW to subtract the row you're on so that it equals 1 (and wrap it in parantheses) for instance here's the same function started on row 5 - note the "(ROW()-4)":
= 2 *( ( (-1 * (2 * $A$1 * (ROW()-4) )) + ( 4 * (ROW()-4) * $A$2 ) + POWER( $A$1, 2 ) + $A$1 - ( 2 * $A$2 ))/( POWER( 2 * $A$1, 2 ) ) )
I'm looking for a formula to return the value from Column E, based on the earliest date in column B, within the Values in Column A in Sample table I attached.
I this instance, I seek to return 50% for Company A, 75% for Company B, and 50% for Company C.
Sample Table
Thanks in advance
Assuming sample data is located at A1:E7 (adjust formulas as required)
(Enter the FormulaArray pressing [Ctrl] + [Shift] + [Enter] simultaneously, you shall see { } around the formula if entered correctly)
To list Companies enter this FormulaArray in G2` and copy till last record
=IFERROR( INDEX( $A$1:$A$7, MATCH( 0, COUNTIF( $G$1:$G1, $A$1:$A$7 ), 0 ) * 1 ), "" )
To extract the earliest % Passed for each company enter this FormulaArray in H2 and copy till last record
=IF( EXACT( $G2, "" ), "",
INDEX( $E$1:$E$7,
MATCH( SMALL( IFERROR( $B$1:$B$7 * ( $A$1:$A$7 = $G2 ) * 1, 0 ),
1 + COUNTIF( $A$1:$A$7, "<>" & $G2 ) ),
$B$1:$B$7 * ( $A$1:$A$7 = $G2 ) * 1, 0 ) ) )
To get the percentage for when column A has a value of "A":
=MAX((MIN(IF(B2:B99*(A2:A99="a"),B2:B99))=B2:B99)*E2:E99)
This is an array formula and must be confirmed with Ctrl+Shift+Enter.
Note: if your data extend further down than row 99, then increase the 99s in the formula.
Note: you can edit the "a" in the center of the formula for "b" or "c". Better still would be a reference to a cell containing the value to calculate on. For example, let's say you enter A in cell G1, you could do this:
=MAX((MIN(IF(B2:B99*(A2:A99=G1),B2:B99))=B2:B99)*E2:E99)
I have below question:
On column A1: A16, I have some repeated dates.
On column B1:B16, I have the numbers which are assigned each one only to a date on column A. For instance, B1 to A1, B2 to A2 and etc.
I copy column A to column C and use from Data – Remove Duplicates.
Now, I want to have total sum of numbers which are assigned to each exact date on column D (front of column C).
I have attached an example of excel sheet.
How can I do?
4/4/2015 20000000 4/4/2015 94010000
4/4/2015 9510000 4/9/2015
4/4/2015 50000000 4/13/2015
4/4/2015 14500000 4/14/2015
4/9/2015 200000000 4/19/2015
4/9/2015 200000000 4/27/2015
4/13/2015 672716000
4/14/2015 28448000
4/19/2015 26168000
4/19/2015 26168000
4/19/2015 18568000
4/19/2015 18568000
4/27/2015 41368000
4/27/2015 13500000
4/27/2015 200000000
4/27/2015 52926000
Extract Unique Items and Corresponding Totals
Assuming that your data is located as follows:
Dates range B7:B21 and Amounts range C7:C21
To extract a list of unique dates enter this FormulaArray in E7 and copy till last record:
(Formulas Array are entered by pressing [Ctrl] + [Shift] + [Enter] simultaneously)
=IFERROR( INDEX( $B$7:$B$21, MATCH( 0, COUNTIF( $E$6:$E6, $B$7:$B$21 ), 0 ) * 1 ), "" )
Then to have the total amount for each date in the next column enter this formula in F7 and copy till last record:
=IF( EXACT( $E7, "" ), "", SUMIF( $B$7:$B$21, $E7, $C$7:$C$21 ))
I've following data set and I've used Index- Large function
=LARGE(INDEX(($A$2:$A$99)*($B$2:$B$99={"x","y"}), , ), ROW(1:1))
... to find out Top 25 of x and y combined. How would I pull the Column that has listed fruits? I can't use Large since it's for Numbers only. I've 20 more columns that have text only. Any thoughts?
apple 100 x
banana 50 y
grapes 6 z
watermelon 89 x
cantaloupe 5 x
orange 24 y
You need to adjust the formula you provided for the correct columns first.
=LARGE(INDEX(($B$2:$B$99)*($C$2:$C$99={"x","y"}), , ), ROW(1:1))
When that is done, it can be used as matching criteria in a larger formula that also matches column C for x, y.
=IFERROR(INDEX(A$2:A$99, MIN(INDEX(ROW($1:$98)+(($C$2:$C$99<>{"x","y"})+($B$2:$B$99<>LARGE(INDEX(($B$2:$B$99)*($C$2:$C$99={"x","y"}), , ), ROW(1:1))))*1E+99, , ))), "")
In the sample image below, that formula would go into E4. Fill both right and down as necessary.
If the values in the nmbr column may be duplicated (while still matching {x, y}) then one formula cannot be used for the entire lookup table. Use the following in F4.
=LARGE(INDEX(($B$2:$B$99)*($C$2:$C$99={"x","y"}), , ), ROW(1:1))
E4 would be,
=IFERROR(INDEX(A$2:A$99, SMALL(INDEX(ROW($1:$98)+(($C$2:$C$99<>{"x","y"})+($B$2:$B$99<>LARGE(INDEX(($B$2:$B$99)*($C$2:$C$99={"x","y"}), , ), ROW(1:1))))*1E+99, , ), COUNTIF($F$4:$F4, $F4))), "")
Copy and paste E4 to G4 then select E4:G4 and fill down.
Note that when transcribing the formula for your own use, ROW(1:98) is the position within A2:A99, not the actual row on the worksheet.