Formula reference holds for n cells in a row, then switches to new reference - excel

I wonder if there's a quick solution to the following:
My goal is to divide a cell value by three, using the same value for three cells in a row, then switch to the next value in the series for another three cells in a row, and so on.
So my starting data would look like:
A B C D E
1 9 12 6 21 27
2 30 9 3 0 3
3 ...
I want the new cells to look like:
AA AB AC AD AE ...
1 3 3 3 4 4
2 10 10 10 3 3
...
Where the cell AA1 = A1/3, AB1 = A1/3, AC1 = A1/3, but AD1 = B1/3 and so on.
I need to do this for many observations, preferably using an excel formula.
Does anyone have any ideas on quick solutions?
Really appreciate your help.
Best,
Henry

Use INDEX:
=INDEX(1:1,0,ROUNDUP(COLUMN(A1)/3,0))/3

Related

How to use Fill Handle to copy same value in the same steps of row in Excel

confuse wiht the Title
Well sorry my English doesn't look good
but I'll try to describe what I mean
Suppose I have this kind of values
0 A B C D F G H I J
1 20 =B1
2 10 =B3
3 30 =B5
4 8 =B7
5 9 =B9
6 4 etc.
7 79
8 67
9 63
10 45
as you seen above
I want to copy every value in cell B in two step down to cell D with Fill Handle
How can I do it ?
Any Formula I can use regarding this ?
Thanks before
In Cell D2 you can use the below formula, then drag down:
=INDEX(B:B,(ROWS($B$1:B1)*2)-1,1)
Please try:
=OFFSET(B1,ROW()-1,)

Excel using SUMIF to calculate totals of multiple columns

I'm trying to use Excle's SUMIF to calculate totals of Col1 to Col5 for dates that are similar.
My formula is as follows =SUMIF($A2:$A7,A10,$B2:$F7), but this only gives me the total of a single column.
How can I get the Totals of all the columns based on the date like I've shown in my results.
Date Col 1 Col 2 Col 3 Col 4 Col 5
1/5/2017 1 2 2
1/5/2017 5 3 1
1/5/2017 9 5 5
2/5/2017 10 5 3
2/5/2017 20 10 3
2/5/2017 6 8 1 5
Desired Results
1/5/2017 15 7 7 3 1
2/5/2017 30 11 11 11 8
use below formula in cell B11
=SUMIF($A$2:$A$7,$A11,B$2:B$7)
Per the example you provided, One solution is to use SUMPRODUCT
Multiplies corresponding components in the given arrays, and returns the sum of those products
Microsoft Docs give a thorough example, but per SO etiquette, here is an example in case of link-rot: [FYI, I used absolute reference for easier filling across, arbitrary how you get it done though]
Forumlas shown:
Formula is kind of hard to see without clicking on image:
=SUMPRODUCT(($B$3:$B$8=$B$11)*C3:C8)
This basically breaks down like this, it searches the B:B column for a match, and it will naturally return a true or false for the match, or 0/1 counterparts, and multiplys that by the number found in the column to the right (C3:C8), so it will either be 1 * # = # or 0 * # = 0

Analysing data using the column name

I have the following data.
Z Y Z Z
A1 A2 A3 A4 Total
1 2 5 10 16
2 3 5 11 18
3 4 6 12 21
4 4 7 12 23
I want to sum the rows using Just Zs ( the name of columns). I have a big data set, so I want to write a function to find out Zs in the whole sheet and the then sum them (Total).
Any Help would be appreciated
This can be done with SUMIF():
=SUMIF($1:$1,"Z",2:2)
NOTE
With the above formula it is using full row references so DO NOT put "Z" on top of the total column or it will throw circular errors.
If you want to have "Z" above it then you need to define the ranges:
=SUMIF(A$1:D$1,"Z",A2:D2)
How does this work:
=Sum(If(A$1:D$1="Z",$A$2:$D$100))
Assuming your headers are in row 1, columns A to D, and your data starts in row 2, and goes to row 100.

Finding the first specific value above a certain cell

I'm looking for a way to find the first specific value above a certain cell.
Using the example below, in the result column every time I hit a A in COL2, I need to substract the value in COL1 to the first A value above.
The trouble seems finding a way to keep the range dynamic...
I thought of =IF(B5="A";A5-INDIRECT("A"&MATCH("A";B:B;0));"")
But of course that only works for the first one as Match will always pick up the first one.
Any ideas? Thanks!
Example :
COL1 COL2 Result
1 A
2 0
3 0
4 A 4 - 1 = 3
5 0
6 A 6 - 4 = 2
7 0
8 0
9 0
10 A 10 - 6 = 4
Try this:
=IF(AND(ROW(B2)<>2,B2="A"),A2-INDEX($A$1:$A1,AGGREGATE(14,6,ROW($1:1)/($B$1:$B1="A"),1)),"")
The AGGREGATE() Function was introduced in 2010.
In D2 enter =IF(B2="A",A2-INDIRECT("A"&MATCH("A"&(E2-1),F:F,0)),"")
In E2 enter =IF(B2="a",COUNTIFS($B$2:B2,"a"),"")
In F2 enter =B2&E2
Copy formulas from D, E and F down all your rows
Column D is the result you're looking for

Identify Rows with Same Values in 2 Different Columns

I have a data set of roughly 405,000 rows and 23 columns. I need the records where the value in column "D" is the same as the value in column "H" for that row.
So for
A B C D E F G H
13 8 21 ok 3 S - of
51 7 22 no 3 A k no
24 3 23 by 3 S * we
24 4 24 we 3 S ! ok
24 9 25 by 3 S # we
75 2 26 ok 3 S 9 ok
etc...
I'd get back the 2nd row, the 6th row, etc...
A B C D E F G H
51 7 22 no 3 A k no
75 2 26 ok 3 S 9 ok
Based on other posts like: Formula to find matching row value based on cells in multiple columns I tried using a Pivot Table, but it complains I can't put either of my two columns in the "Columns" area because there is too much data. With both columns in the "Rows" area, I get a relationship of D to H, but I can't then find a way to filter on only those where D = H.
I've also looked into countifs(), vlookup, and index / match functions, but I can't figure this out. Help please.
I would do a simple "IF()" formula in a new column.
For your example add a new column I and use the following formula in the first data row (I2):
=IF(D2=H2,"Yes","No")
Fill down to the end of the data.
Then using Excel filters or countif you can check the number of "Yes" vs "No" in your data.

Resources