Check if there is at least one value in column C that is bigger then the value in Column B (without Helper Column) - excel

A
B
C
D
1
Product
sales_volume
purchase_volume
Check
2
Product_A
500
400
yes
3
Product_B
600
700
4
Product_C
300
250
5
Product_D
800
620
6
Product_E
100
100
7
In Cell D2 I want to have a formula that is doing the following:
= If there is at least one value in Column C > value in Column B then "yes" else "no"
I know I could achieve this with a Helper Column that subtracts the values from both Columns and then check the Helper Column for values >= 0.
However, I would prefer a solution without a Helper Column.
Do you have any idea if this is possible?

=IF(SUM(IF(C2:C6>B2:B6, 1, 0))>0, "yes", "no")
Be warned this is an array formula so might required you to press Ctrl+Shift+Enter after typing the formula instead of just inserting it normally

If B2 is GREATER than the largest number in the range C2:C6, then "no", else "yes".
Try this formula in cell D2:
=IF(B2>MAX(C$2:C$6),"no","yes")
you can then drag the formula down to other cells

Related

How to use formulae in alternate column in google sheet?

A B C D E
1 Total Penetration Value Penetration Value
2 300000 0.001 300 0.0015 450
3 300000 0.001 300 0.0015 450
How can we drag the formulae across the row with an alternate column?
C2 = B2*$A2
AND
E2 = D2*$A2
I want to drag this formula across the row 1, in alternate column and each column uses the previous column value and fixed value from A2.
Just have to select the two column, B and C and then we have to drag to the entire row.

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)

Select next higher number in array based on a minimum criteria

I have the following Excel spreadsheet:
A B C D
1 0 0.99 Minimum: 6
2 1 0.99 Input: 3
3 2 2.99 Result: 4.99
4 3 2.99
5 4 4.99
6 5 4.99
7 6 7.99
8 7 7.99
9 8 9.99
10 9 9.99
The formula in cell D3 is:
=LARGE(B$1:B$10,COUNTIF(B$1:B$10,">"&D2))
This formula selects the next highest number in the array in
Column B based on the input in cell D3.
For example:
If the input in cell D3 is 3 it will select
4.99 instead of 2.99.
All this works perfectly with the formula in cell D3.
However, now I want to insert a minimum criteria into this system
in cell D1.
For example: If the minimum is 6 the formula in cell D3 should notice it
and select 7.99 instead of 4.99.
Do you have any idea how to solve this issue?
Is there a way to do it without using an array formula?
You can use COUNTIFS to include multiple criteria, instead of your COUNTIF.
So in Cell D3 put the formula below:
=LARGE(B$1:B$10,COUNTIFS(B$1:B$10,">"&D2,B$1:B$10,">"&D1))
It means that the formula is searching for 2 criterias:
Cells Value is larger than value in Cell D2 (Input).
Cells Value is larger than value in Cell D1 (Minimum).
Using INDEX/MATCH you could restrict the range that's looked at, although I feel there's a better way:
=LARGE(INDEX($B:$B,MATCH($D$1,$A:$A,0)):INDEX($B:$B,COUNTA($A:$A)),COUNTIF(INDEX($B:$B,MATCH($D$1,$A:$A,0)):INDEX($B:$B,COUNTA($A:$A)),">"&$D$2))
You could place the INDEX/MATCH into a named range to make the formula shorter.

How to select a value given a set of criteria

I have the following table and would like to select the $
for products when index = max:
id product $ max?
1 A 1 No
2 B 2 No
3 A 2 No
4 C 4 No
5 D 5 No
6 A 3 Yes
7 B 6 Yes
8 C 8 Yes
How do I get the results in the column identified max?
Regards.
UPD:
The results should be based on the max id and not max $. I am sorry for the confusion
If you need formula for max column based on max id, try next one:
=IF(MAX(IF(B:B=B2,A:A))=A2,"Yes","No")
where B:B column with your products, A:A - column with id.
Just select D2, enter formula in formula bar, and press CTRL+SHIFT+ENTER to evaluate it and then drag it down.
Note, if you know exact ranges of your data, you can change B:B and A:A to e.g. $B$2:$B$100 and $A$2:$A$100

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