Excel Using SUMIF to sum and select higher numbers - excel

I have the range of figures below
D E
3000 6500
20000 0
15000 0
16000 20000
22000 0
I would like to take the total of column D but add the figures from column E to replace the corresponding value in column D if it exists. For example 3000 would be replaced by 6500 in the top line and 20000 would supersede 16000 in row 4.
I have been taking the sum of column d and manually subtracting D1 and adding E1 and D4 for E4 however as column E may be populated over time I would like not to have to do this over and over again.
Any help on this much appreciated.

An array formula should handle this nicely.
      
The array formula in D2 is,
=SUM(IF(A1:A5>B1:B5, A1:A5, B1:B5))
Array formulas need to be finalized with Ctrl+Shift+Enter↵.

Without array option:
=SUM(E:E)+SUMIF(E:E,0,D:D)
For higher numbers, you might add a column with a formula such as:
=MAX(D2,E2)
and sum that column.

Related

Formula to calculate a sum of differences and count them

I have the following Excel spreadsheet:
A B C D E F G H
1 Sales 500 700 600 450 550 600 500
2 Helper Row (Differences) 40% -14% -25% 22% 9% -17%
3 Helper Row (Counts) 0 0 1 0 0 0
4 Count Result 1
In Row 1 you can see the sales over different periods. In Row 2 the difference between the sales are displayed. (e.g. formula in C2=C1/B1-1).
In Row 3 the formula indicates 2-Following-Periods in which in total the sales drop by >-20%.
In the case above this applies to cell E3 because the sales in cell D2 drop by -14% and in the next period in cell E2 by -25% which makes a total drop of those two periods by -39%.
The formula I use in Row 3 is for example E3=IF(SUM(D2:E2)<-0.2,1,0).
Eventually, I use a sum function in cell B4 (B4=SUM(B3:H3)) to count how often the above described criteria is met.
All this works perfectly so far. However, my target now is to get rid of the Hepler Row 2 and Row 3.
Do you know a formula that gives me the count result which meets the above described criteria?
Assuming that your above demonstrated numbers are in cell B1:H1, you can use following formulae to achieve result without helper cells.
Array formula (CTRL+SHIFT+ENTER and not just ENTER)
=SUM((((C1:H1-B1:G1)/B1:G1)<-0.2)+0)
Or for normal ENTER
=SUMPRODUCT((((C1:H1-B1:G1)/B1:G1)<-0.2)+0)

How to get weighted sum depending on multipliers in column in Excel?

I have the table in Excel:
In column C (Sum) I want to get sum this way:
If in column A or B value is 1 then take Amount 48 and multiply by Multiplier (1) = 2.
If in column A or B value is 0 then take Amount 48 and multiply by Multiplier (0) = 1,5.
Then K1 and K2 summed.
So for row 2 the result in column C will be: 48*2 + 48*2 = 192.
For row 5 the result in column C will be: 48*1,5 + 48*2 = 168.
Is it possible to automate this process using Excel formula for C column (inspite of number of columns)?
Or you could use Countif (no shorter though)
=COUNTIF(A2:D2,0)*I$2*I$1+COUNTIF(A2:D2,1)*I$3*I$1
Use Ctrl+Alt+Enter when entering (since it's an array formula)
EDIT: I'm not great with formulas, so there is I'm sure a shorter alernative...

Find Cell Address

ColumnA Column B Column C
name sales index
A 1250 1875
B 5500 15000
C 4500 5625
F 12750 13125
B 7250 28125
F 2000 13875
E 9250 23625
F 39250 16875
A 2250 25500
B 7250 15750
A 8250 29250
B 16500 11625
C 500 804000
In the above table I want to find out the cell address when F has maximum sales. Can somebody help me with excel formula. e.g. in the above table the output will be B9
Try:
="B" & MATCH(MAX(IF(A:A="F",B:B)),IF(A:A="F",B:B),0)
This is an array formula and must be confirmed with Ctrl-Shift-Enter. This will return the address of the first max value for "F" if there are equal values that are the max.
Also as noted by #XORLX Change the whole column references to the actual data size or big enough to cover what is needed. This will speed up the calculation. With the Array formula it will iterate through the whole column twice. It will run over 2 million times.
Though the real question is for what purpose are you going to use the answer? If the end is to merely know the address then use the above.
But if not then there may be a way to get to the end in one step.

SUMIFS Formula that would check multiple columns

I have an excel sheet and am attempting to incorporate a SUMIFS formula which would check one column for an condition then check another group of columns to see in the match a condition in order to sum all the values which are > 50000 in the group of columns then multiply those values by 0.084.
My formula returns the #VALUE error. How can I achieve what i want?
A B C D E F G H I
NO 51000 52000 12000 10000 53000
NO 23000 48000 54000 55000 50000
=SUMIFS(E10:I610,A10:A610,"No",E10:I610,">50000")
Help please...
You can switch it to a SUMPRODUCT formula, which can handle the multiple columns:
=SUMPRODUCT(E10:I610*(A10:A610="No")*(E10:I610>50000))
EDIT:
Per JosieP, this will work even if there are text values in the range:
SUMPRODUCT(E10:I610,(A10:A610="No")*(E10:I610>50000))
=SUM(IF(A10:A610="N",1,0)*IF(E10:I610>50000,1,0)*E10:I610)
The above when used as array formula (by pressing ctrl+shift+enter, instead of enter) works too.

How do I add a column of numbers which are in the same row as a date that is less than or equal to Today()?

In Cells A1:A4 I have Dates. In Cells B1:B4 I have numbers. In C1 I have todays date. I want in Column D1 the sum of all the values in B which have a corresponding date in column A that is less than or equal to the date in C1. For example:
A B C D
1 6.6.13 300 8.6.13 512
2 7.6.13 200
3 8.6.13 12
4 9.6.13 5
D1 Should be calculated by a formula. How can I achieve this with a formula. I have tried
=SUMIF(A1:A4;<=C1;B1:B4)
but it seems to not be correct.
The if condition has to be in quotes; try the following:
=SUMIF(A1:A4;"<="&C1;B1:B4)

Resources