SUM cells that are 4 cells RIGHT of a specific date - excel-formula

I have a ledger and I want to SUM the cells that are 4 cells RIGHT of any specific date.
For example I want to SUM all the numbers in all cells 4 spaces RIGHT of the 01-Feb-19
Many thanks,
Colm

A simple SUMIF will do it:
=SUMIF(A:M,"01-Feb-19",E:Q)
The key is the offset same size ranges.

Also you can you:
=IFERROR(VLOOKUP($B$29,A2:E23,5,FALSE),0)+IFERROR(VLOOKUP($B$29,G2:K28,5,FALSE),0)+IFERROR(VLOOKUP($B$29,M2:Q26,5,FALSE),0)
at B29 import the date you want to sum (see image)

Related

Excel Sum X amount of columns depending on a value in another cell

Is there a way that you can use sum() in excel and that sums up x amount of columns depending on number given in another cell.
See below for example
Example of how it's today
In this picture I have columns B:M were I put in Actual figures.
And in columns T:AE I have budget figures.
In this example I have actual figures JAN-MAY and would like to compare them vs budget JAN-MAY.
How I do today is that I go in to column AF and drag so it's =SUM(T6:X6) so it only takes T:X in this case.
But I would like that cell AF has a formula in it were it looks at cell AH:3 and sees that it's number 5.
Therefore AF should sum(T;U;V;W;X(5columns))
Hope you understand my problem and have a solution!! :)
You can use the OFFSET function to determine the number of columns to SUM. In your example, AH3 is your offset amount.
In AF6 you can place this formula:
=SUM(T6:OFFSET(T6,0,AH3-1))
Which breaks down to
=SUM(T6:OFFSET(Start at T6, Offset 0 rows, Offset columns the value of AH3 and subtract one for a total of five columns))

Excel sheet dynamic summing condition based

Say I have the following numbers in cells in suceeding rows of column B 1,24,23,12,15,17. How do I get Excel to only add up to that cell so that the sum equals a predefined number (say 25) and return the corresponding row number at which this condition is satisfied?
In the example above, it should add B1 and B24 whose result equals the predefined number (25) and return row 2 as a result.
The challenge is unlike SUMIF and similar commands, I cannot prescribe a range B1:B6 or so. Instead of B6 it should be some number Bx where x (2 in this case) is decided on the fly. Does that make sense?
Thanks in advance.
You cannot do it with a single formula, but you can do it by adding a column with running totals. See this code example:

excel formula to add cells in a single row based on criteria

Let's say,
Sheet1:A1 = x
Sheet2 contents look like
x 3 3 4
y 0 2 1
Is there an excel formula that could match Sheet1:A1 with Sheet2:A1 (basically the value 'x') and add the other cells in that row (3,3,4). The result (Sum='10') should get updated at Sheet1:C4 lets say.
I tried SUMIF but that shows the content of only one column due to the restriction that it can handle only the matchable array size. I know this can be achieved through VBA, but just wanted to know if a formula is available.
TIA!
This formula will do what you want:
=SUM(SUMIF(Sheet2!A:A,A1,INDIRECT("Sheet2!" & {"B:B","C:C","D:D"})))
It will iterate through the columns doing individual SUMIF() on each and then adding the results.
If you want more columns or different change the address in the array to the columns desired.
Try the following
=SUM(IF(Sheet2!A1:A99=A1,Sheet2!B1:D99,0))
Note that this is an array formula, so it must be entered using Ctrl+Shift+Enter.
What this formula does is converts any rows on Sheet2 without x in column A to zeros in B:D and then sums what is left.
Similarly, you could use
=SUMPRODUCT((Sheet2!A1:A99=A1)*Sheet2!B1:D99)
and you wouldn't have to enter it as an array formula.
For a non-volatile, non-array formula, try this
=SUM(INDEX(Sheet2!B:D,MATCH(Sheet1!A1,Sheet2!A:A,0),))

Excel Forumula - How count last 7 cell in a column?

I would like to get help on how to write a formula that would count the values in the last 7 cells of my column.
Is someone can help me on this ?
thanks
Not sure if this is the most optimal solution, however, it should work to sum up the values of the last 7 cells in a given column (in my case, column A):
It assume no blank cells in the list ...
=SUM(OFFSET($A$1,COUNTA(A:A)-1,0,-7,1))

Find the biggest change in values in a list?

How would you find the biggest difference/change in values of a list of numbers in Excel?
An example of what I'm looking for is 1,3,4,5,9,10,11,13
The value I would look for is 4 as this is the biggest difference (between 5 and 9).
Is there a way to do this with a list in Excel?
A picture is worth a thousand words? :p
EDIT:
Description added:
As shown in the image, put the formula in =A2-A1 in Cell B2 and then drag it down. Once you have your values, use the Max formula to get the maximum value as shown in Cell D5
Add another column to contain the difference. Assuming your values are in column A, then the formula would be "=A2-A1" copied down the list. Few ways after this.
(1) You can eyeball which is largest
(2) you can copy values (make sure is values) to a this column and sort descending
(3) You can build pivot off that this column. and double click the largest to find the detail
If values are in distinct cells (A1:A8):
=MAX($A$2:$A$8-$A$1:$A$7)
seems to work (as an array formula, enter with Ctrl+Shift+Enter).
Put the values in a column.Say, Column A
In cell B1; write a formula. =A2-A1
Copy the same formula to the entire Column B, for every value in column A
Go to the end of column B, and write a new formula, =MAX (B1:B)
Create a new column with the differences:
=A2-A1
And drag down.
Find the max value:
=MAX(B1:B9)
Find the index of the max difference value:
=MATCH(MAX(B1:B9);B1:B9;0)

Resources