Change values of cells based on the total in excel - excel

in excel I'm trying to accomplish a scenario where I have a total in one cell as 100% above which I have three Cells which have their values referenced from other cells please see the image below
In here my first total cell value is fixed i.e., 50% and on which the next total will be calculated to 100%.
Now my problem is adjusting the #3 values to 100% based on user input values from before cells
Looking forward for a solution.
Thanks a lot in advance!

Try this
Insert below formulas in B column and check. here formula in cell A4 is =SUM(A1:A3)

Related

What is the best way to formulate an average with a vertical criteria and horizontal range in excel?

What is the best formula to get the average if Criteria is Vertical and Range is Horizontal? I have multiple sheets and workbooks that needs to be averaged based on its criteria and doing manually is not the best way.
I tried using =AVERAGE(IF($E$1:$Q$1=A2,E2:Q15)) however blank cell are being considered with 0 value and affects the actual average. blank cell should not be calculated on as zero on average.
Edit: Added tried/not working formula.
The formula below will work for cell A2 (and can then be copied down)
=SUM(INDEX($E$2:$Q$15,,MATCH(A2,$E$1:$Q$1,0))/COUNTIF(INDEX($E$2:$Q$15,,MATCH(A2,$E$1:$Q$1,0)),">0"))
if you don't have dynamic arrays then it must be entered as an array formula with Ctrl+Shift+Enter
(if you have Excel 365 then the formula can be shortened
=LET(data,INDEX($E$2:$Q$15,,MATCH(A2,$E$1:$Q$1,0)),SUM(data)/COUNTIF(data,">0"))
)

How to calculate average of values between blank cells in a single column?

I have a dataset containing several columns (A, D, G....etc). Each column contains blocks of data that are separated by single blank cells (A2-A14, A16-A28, A30-A.... etc). These blocks of data each have a different number of cells within them. I have been trying to find a way to calculate the average and standard deviation of each of the blocks by dragging the formulas, but can't figure it out. Any ideas?
excel data screenshot
I think you can try the following formula in B2:
For AVERAGE:
=AVERAGE((INDEX(A:A,ROW()):INDEX(A:A,MATCH(TRUE,INDEX(ISBLANK(INDEX(A:A,ROW()):A$10000),),0)+ROW()-1)))
Then copy and paste the formula in the other yellow Average cells. The formula should adapt by itself.
Change the 10000 reference if need be
For STDEV paste the following in C2 and copy over:
=STDEV((INDEX(A:A,ROW()):INDEX(A:A,MATCH(TRUE,INDEX(ISBLANK(INDEX(A:A,ROW()):A$10000),),0)+ROW()-1)))
And if you really want to drag the formula down (which is a waiste of CPU) you can put a simple IF in front, like so:
=IF(OR(A1="",A1="Unit"),<earlier mentioned formulas as a whole>,"")

Excel measuring arithmetical average (counting blank cells)

I have a problem in Excel. I'm making a program to monitor the consumption of fuel per month. As I do not tank fuel every day, but only every couple days I'd like the program to measure aritchmetic mean for me.
This means it would take the last input and count all blank cells above (excluding my previous input) and measure the mean of fuel consumption in these days.
Example of how it should work:
[link to image] http://i64.tinypic.com/2dre87m.jpg
Edit: If anybody knows how to count number of empty cells between 2 inputs it would also suffice to me.
I was able to get your desired results using an array formula. Assuming your headings Day,Fuel, and Average are in cells A1, B1, and C1 respectively; copy and paste the following formula in cell C2 hit CTRL+SHIFT+ENTER and drag the formula down your column.
=IFERROR(IF(B2="","",(B2/(LARGE(IFERROR(MATCH($B$2:B2,$B$2:B2,0),""),1)-LARGE(IFERROR(MATCH($B$2:B2,$B$2:B2,0),""),2)))),B2)
It gave me a "formula omits adjacent cells" error, but we want to omit the cells below the target row on purpose, so just ignore the error. Hope this helps.
Try this formula:
=IF(B2="","",ABS(B2/(MATCH(0,B$2:B2,-1)-SUM(MATCH(0,B1:B$2,-1)))))
in C2 and copy down.
if cells in column B can contain string values then you can use this formula:
=IF(ISNUMBER(B2),ABS(B2/(MATCH(0,B$2:B2,-1)-SUM(MATCH(0,B1:B$2,-1)))),"")

Formula with dynamic variables in excel

I have an Inventory of boxes as an excel sheet with two columns(Total and Usage). The column on the right(total) has a value which shows the initial number of boxes. In the left column(usage) I give the number of boxes that I remove from the stock on a date. I want the right side column(Total) to be updated automatically.. Meaning if the total value at the start is 50 and I use 4 boxes then i want the cell in the total column at that row to show the new total
Example My total value is initially 50(B2) and i use 4 boxes(A3). I want B3 to show the new total... As i keep adding usage values in column A i want column B to be updated as (previous total - new usage) How to do this in excel? I dont want to type in the formula in each cell and i dont know if i can assign varaibles to cells. Is it possible?
I am assuming you want to use subsequent rows to record each withdrawal of some boxes? You need to enter the appropriate formula in each cell of the total column. So in B3, put =B2-A3. Then copy-paste that to all cells below in col B, Excel will paste a formula whose cell references are relative to the cell the formula is pasted to. Alternatively there is a mouse drag gesture that's even faster to fill a column with a formula.

Sum of row n through last row

I want to create a TOTAL row at the top of my spreadsheet. In this row, each cell should be the SUM of the values in the column below the TOTAL row.
So for example, if the total row is Row 1, cell A1 should be the SUM of A2 through the last row in column A. The number of rows in the spreadsheet will grow over time, so I can't just say SUM(A2:A500) because eventually there will be row 501, 502, 503 etc.
If you want something that just works in Google Spreadsheets (as the title suggests), you can use open-ended ranges:
=SUM(A2:A)
In Excel, you can specify the maximum rows for that version; for example, for 2007 and 2010:
=SUM(A2:A1048576)
This will work in Google Spreadsheets as well, and is beyond the current theoretical row limit in GSheets (400000)*.
Edit: *The quoted limit of the new version of Sheets is actually now 2 million cells.
Try this
=SUM(OFFSET(A1,1,0,ROWS(A:A)-1,1))
Works in both Excel and Google Docs
One downside: by using OFFSET the formula becomes Volatile ie is calculated every time the sheet calculates irrespective of data change.
One way you can do this in both Excel/Google Spreadsheets is to add a dummy column with a single value at the top (and all blanks for the remainder of the column).
You can then do a SUMIF to summarize all values except the one which is not "" - which should just be the cell A1 - put the following in B1, with whatever numbers below B1 you want and anything in A1.
=SUMIF(A:A,"",B:B)
=(B3+C3+D3+E3+F3+G3+H3+I3+J3+K3+L3+M3)
This worked for me. 3 being the row number
When you Drag the box downward the formula transfers down and changes the row number automatically for each row.
After I put another heading several rows down
adding the word SUM into the formula worked.
=SUM(B19+C19+D19+E19+F19+G19+H19+I19+J19+K19+L19+M19)
Not sure if it was necessary. But just copy pasting the first formula I used into the lower segment made an error message.

Resources