How to round a formula without creating another column? - excel-formula

This is the formula (To calculate vat prices) is located in cell G7
=D7*$G$1+D7
I would like to add the ROUNDUP(G7,2) to its cell so that the results are rounded to 2 decimal places.

Simply put the Formula contained in G7 in brackets and insert it.
=ROUNDUP((D7*$G$1+D7),2)

Related

How to simplify the formula for sums with one variable in Excel

I need to sum the result of a formula, repeated several times, which has a single value that changes from 1 to 180.The final formula must be contained in a single cell.
Column A contains values ​​from 1 to 180 (to simplify in the example I have only put 13).
Cell B1 contains a value expressed as a percentage.
Column C (C1 to C13) contains the following formula (cell C1 in the example):
=+((1/(1+(A1*1/12*$B$1)))).
Cell C14 contains the sum of all results.
By defining X the variable value of column A, the formula is in practice the following:
Column A will be not present in my sheet, so therefore I cannot refer my formula to the contents of any cell.
My need is to have only two cells in my sheet: B1, with the rate value; and C1, with the sum of the products with X from 1 to 180. That is what is contained in cell C14.
Thanks for your help and for your patience with my bad English.
This can be done using SUMPRODUCT:
=SUMPRODUCT(1/(1+(A1:A13*1/12*$B$1)))
You can use the SEQUENCE() function for your problem to replace the column A in your example.
More specifically, you can write the formula:
=1/(1+SEQUENCE(180)/12*B1)
which will automatically create an array with a length of 180 cells returning your desired series of values.
If you don't want to 'print' out that series at all but only show the sum right away, simply enclose the formula with the SUM() function:
=SUM(1/(1+SEQUENCE(180)/12*B1))

Excel: Apply formula to each cell in column within another formula

I have a column of numbers. I want to ROUND the numbers in each cell of the column and then take the SUM of the cells.
Of course this can be done by creating another column with the rounded values and then taking its sum.
Say that I have 10 cells in column A. I round them to the nearest 0 using ROUND(A#,0) for A1 through A10. These new values go in B#. Then in B11 I have SUM(B1:B10).
Is there a way to apply the ROUND forumla to each cell in column A within the SUM function so that I do not need to create another column of values?
SUMPRODUCT 'Deals' in Arrays 2
=SUMPRODUCT(ROUND(A1:A10,0))
Just use an array formula - enter with Ctrl + Shift + Enter.
=SUM(ROUND(A1:A10,0))
For example (also shows the rounded numbers in Column B to show it works, or you can see the magic with Formulas > Evaluate Formula.)

Excel formula - Sum cells until blank cell

Further to my previous question, Im trying to get cell E20 (Total) to work similarly - sum all cells preceeding until the the formula itself (E20), again to avoid any cells being excluded as rows are added. So far i have:
=SUM(INDEX(E:E,ROW()+1):INDEX($E:$E,ROW() + IFERROR(MATCH(“TOTAL",INDEX(D:D,ROW()+1):$D1004001,0)-1,MATCH(“TOTAL”,INDEX(D:D,ROW()+1):$D1004001,0)-1)))
So far I am simply returning an error message.
I am trying to sum everything in column E until it reaches one cell above the word Total in column D, to avoid a circular reference. Any thoughts?
Screenshot of workbook
No volatile or array formulas needed:
In E2:
=IF(F2="",SUM(INDEX(F:F,ROW()+1):INDEX(F:F,MATCH(1E+99,F:F)))-SUM(INDEX(E:E,ROW()+1):INDEX(E:E,MATCH(1E+99,F:F))),"")
And copy down the Column. Then a simple sum formula at the bottom
E2:
=AGGREGATE(9,6,(OFFSET(F3,0,0,
AGGREGATE(15,6,ROW(F3:F999)/ISBLANK(F3:F999),1)-ROW(F3))))
Copy/Paste into E8 and E14. The formula for the Total is pretty simple:
E20:
=SUM(E$2:E19)
After entered as indicated, these formulas will auto-adjust when you insert or delete rows in between, because they use relative references.
There's probably better ways, but this will work. I In cell E2, =SUMIF(F1:F7,"<>""""",F1:F7) and similarly in cell E8, etc. The range intentionally includes blank lines above and below each block of data, to ensure that Excel will adjust for any lines that you insert or delete.
For E20 you can just use the same format, =SUMIF(E1:E19,"<>""""",E1:E19)

Creating a column formula in excel, changing only one variable

I have a very basic excel file for looking at the cost of shares and calculating a profit/loss %.
I have the initial purchase price in cell E3 and I have the current share price in F3. I have calculated the percentage profit/loss in G3 by the following formula
=(F3/E3)*100 - 100
What I now want is to be able to apply this formula to the whole G column as I enter a new share price into the F column, it will use E3 as a constant in the formula to calculate daily profit/loss. So the new formula I want is effectively;
=(Fi/E3)*100 - 100
Where Fi = F3, F4, F5, F6 and so on...
I have tried dragging the cell down to extend the formula, which works to an extent but it does not keep E3 constant so I get a divide by zero error.
Any suggestions? Thanks
Start with =(F3/E$3)*100 - 100. The $ is an absolute anchor that tells the formula not to change the 3 in E$3 when filled down.
If there is no value in column F, you can have the result returned as a zero-length string (e.g. "") which will make the cell in column G that holds the formula look blank.
=IF(LEN(F3), (F3/E$3)*100 - 100, "")
Use an absolute reference for E3 in the formula:
$e$3
This will lock the reference if you drag the cell down.
The other way around, if you want to lock the character:
=(F3/$E3)*100 - 100

Average of Maximum Between Columns

An excel table have two columns of grades. I would like to calculate the average grade but adding only the maximum grade of each row.
It is possible to do this by adding additional column that would contain max of each row and calculating the average of it. I am interested to know if there is a cleaner solution that relies only on formulas.
Let's say in cell A1, you have the heading "first" and in B1 you have "second"
In cells A2 to B4, put in your number grades. Use the following formula in D2.
=AVERAGE(IF(A2:A4>B2:B4,A2:A4,B2:B4))
Hit ctr+shift+enter so that the formula has curly brackets and looks like so
{=AVERAGE(IF(A2:A4>B2:B4,A2:A4,B2:B4))}
This is an array formula and so it's looking at A2, checking if it's higher than B2, if so, it takes A2, otherwise takes B2. It then does this again with A3 and B3 etc and builds up an array of the figures you need to calculate the average (but doesn't show them to you).
The average on the outside is then calculating the average of the numbers in the array.
This assumes your grades are number scores and not letters. Apologies if my assumption is incorrect.
If you want to use the helper column, you could use the formula MAX().
Example: =MAX(A2:B2) would give you the larger of the two. Just copy down the column.
Then you could still use the AVERAGE() function to average the numbers in that column.

Resources