Formula in excel to increment by percentage X number of times - excel

I have a pretty simple problem I am trying to solve, but can't figure it out and can't even think of what to put in google.
I have two cells in excel. One (A1) will have a number, say from 0-100. In the other (A2) I want to start with 15 when A1 is 0, and increment by 15% for each increase in A1. Here is what should show at various points:
A1 - A2
0 - 15
1 - 17.25
2 - 19.8375
3 - 22.81313
...
10 - 60.68337
...
20 - 245.4981
and so on... Basically in this form it is just the cell above * 1.15. But I can't figure out how to condense that into a single formula.

Using a more "standard" spreadsheet nomenclature:
| A B
---+-----------+-----------
1 | 0 15
2 | 1 17.25
3 | 2 19.8375
If you just want the cell to be 15% more than the cell above it, put in (for example) B2:
= B1 * 1.15
and copy that to all other B cells below B2.
If you want it based on An (if, for example, the A cells may not be consecutive), you can use powers (again in B2):
= B$1 * (1.15 ^ A2)
though I'm wasn't entirely sure if ^ is the exponentiation operator in Excel, I've long since switched to Gnumeric. A quick web search seems to indicate that it is the correct operator.

Related

A function or VBA code to determine the last digit in a number

In Excel 2016 I have multiple rows containing numbers no greater than 3 characters listed in column A. I am trying assign a group number based on the right most character in each row that are in column A. Once the number is determined the result is placed in column B of the corresponding row.
Example:
If rightmost character of the number is: a 1 or 6 in cell A1, then in column B1 it's given a 1.
If A1 is a 2 or 7 then B1 is 2.
If A1 is a 3 or 8 then B1 is 3.
If A1 is a 4 or 9 then B1 is 4.
If A1 is a 0 or 5 then B1 is 5.
Any suggestions on how to perform with a function or VBA code are appreciated.
Following your problem statment exactly: in B1 you can enter the formula:
=IF(MOD(MOD(A1,10),5)=0,5,MOD(MOD(A1,10),5))
And copy it down as needed.
The part MOD(A1,10) pulls off the last digit. You seem to want the remainder of this mod 5 -- hence the outer MOD in (MOD(MOD(A1,10),5). But -- if the mod is 0 you want to report it as 5 -- hence the overall IF
However -- an even quicker way is just:
=IF(MOD(A1,5)=0,5,MOD(A1,5))
Since literally pulling off the first digit is superfluous since 5 is a divisor of 10.
Finally, #chrisneilsen gave an elegant formula which is even shorter:
=MOD(A1-1,5)+1
For all remainders other than 0 , the -1 inside the MOD and the +1 outside cancel each other, but for multiples of 5 (remainder 0) the -1 inside the MOD converts the number to one with a remainder of 4, with 4 + 1 = 5 the final answer.

Excel countif(s) multiples

I'm trying to calculate the count of multiple occurrences of a figure using countif.
I have the range set but I need a calculation which can count in multiples of 50 without me having to type thousands of versions of countif (=COUNTIF(B2:B5,">=50")-COUNTIF(B2:B5,">100" etc.).
Data Count
50 1
70 1
80 1
10 0
150 3
This data should show 6 but at the moment I'm getting 4.
First you can start by making bins. you can make it with Data analysis tool or half manual
Like in the example, on A2 enter 0 and on b2 enter =a2+50
Same goes for a3 enter =b2 and last on a4 =a3+50
Now you can drag it down as much as you like.
Instaed of using countif use sumif finction. let's assume your data is on cloumn H and the values you want to sum are in column I, then on c2 enter
=SUMIFS(I:I,H:H,">"&A2,H:H,"<="&B2)
you can drag it down as much as you like.
Simply use Excels ROUNDDOWN function:
e.g. for B2: =ROUNDDOWN(A2/50,0)

Nested IF Excel formula

I am currently using the following formula i.e. =IF(COUNTIF($A$1:A2,A2)>4,A2+1,A2) to change the number when I drag this formula downsdie of the rows.
For Example: in this case for every five rows number will change i.e. A1 to A5 it will 1 and A6 to A10 it will be 2 and A11 to A15 it will be 3 etc.
Just wanted to know is it possible to extend the same formula, so along with adding 1 number for every five rows it should also skip 2 numbers for every 60 rows.
For Example: if the 60 row is number 12, then 61st row should be 15 and 120 row will be 26 and 121 row should be 124 etc.
Can someone please help me with this formula?
Thanks for your help in advance.
Number starts at one.
Then get the cell's row number and subtract one. Divide that number by 5 and discard the fractional part (or the remainder). So numbers from 0 to 4 (which are rows 1 through 5) all get an increment of 0, 5 to 9 get 1, and so on. Similar logic with multiples of 60 except that the counting is doubled.
=1 + floor((row()-1)/5, 1) + floor((row()-1)/60, 1) * 2

Averaging daily varying column in excel vb

Every day I have to analyze two cols of numbers.
Cols differ each day.
Col 1 has no.'s from 1 to 5, eg. Day 1 there are 150 x 1's and 200 x 2's, etc. Day 2, 350 x 1's and 85 x 2's etc.
Col 2 has values between 1 and 99.
I need to count how many 1's there are to obtain a 1's average, 2's ave., etc. So far I have tried to write a vb program (excel 2010) - I have written the following:
Function Phil2()
ct = 0
For X = 2 To 10
If ax = 1 Then Let b15 = b15 + bx
ct = ct + 1
Next
End Function.
But I cannot get it to display. Can anyone help me?
I want the average of the 1's in cell b15.
See the formula bar for what is in cell E1. If you don't have XL2007 or above, the formula becomes:
=IF(ISERROR(SUMIF($A$1:$B$10,D1,$B$1:$B$10)/COUNTIF($A$1:$B$10,D1)),"",SUMIF($A$1:$B$10,D1,$B$1:$B$10)/COUNTIF($A$1:$B$10,D1))
You could also make more "automated" by using Dynamic Named Ranges for your ID (1,2,3..) and data (%) sets, that change each day.
OK, It works fine - I modified your formula to:
=IFERROR(AVERAGEIFS(B$16:B$500,$A$16:$A$500,$A2,B$16:B$500,">0"),"")
and it works perfectly for values 1, and 2. So that's a great start. I placed the formula cells on top: so in a1 I typed cow no., in b1 %Milk, in c1 %weight, etc.. In a2 I typed 1, a3 2, a4 3 etc.. In b2 your formula etc.. My next challenge is to lump together all cow types 3 to 11. So next to cow type 1 we have a % for each category, same for cow type 2, etc.. But the 3rd row must have an average for all categories 3+. Raw data cow types are in a10 down, vals in b10, c10, etc.

Microsoft Excel 2010: Help making a Formula to up Values by a repeating pattern

I have a Spreadsheet, and inside this sheet contains a column with numbers, I want to make a formula that will go down that Column and do basically this.. Values: 1 will be 9.50. 2 will be 9.75. 3 will be 10.00. Ect going up to Value of 100? Is that possible for a Formula? I keep playing with it but can't really seem to get it down. Any help would be appreciated.
Column A: 1
1
1
1
1
2
2
2
2
2
2
2
2
2
3
3
3
3
There is not a set amount to how many values are in there.
this should do it supposing that column A has these values 1, 2 ...etc that your computing will be based on
=MIN(9.25+A1*0.25;100)*COUNT(A1)
In A2, enter the formula
=A1 + (9.5-A1)
then in the cell just below it (A3), enter
=A2+0.25
Assuming A1 is the top left. Copy the formula in A3, select the next 399 cells and paste. Then select A2 - A364 and copy. Then select B2 -xx364 and paste. xx is the last column with data. If you want, set the height of your first column to 0 to hide it.
=(A1-1)*0.25+9.5 where A1 contains any number you want

Resources