if greater than or less than and zero - excel

This is stock status across the country.
How to apply the if condition following stock statement.
If there is any stock in column A than its “Blanks” in Column C
If there is no stock in column A (0) and if there stock in column B than its “To Order” in Column C
If Column A greater than B and IF Column B greater than A than its “Blanks” in Column C
If Column A and B are equal to 0 than its “ Urgent” in column C
UK USA TEXT
1920 0 Blanks
1920 0 Blanks
0 362 To Order
0 362 To Order
113 0 Blanks
113 0 Blanks
196 672 Blanks
1000 89 Blanks
89 1000 Blanks
0 0 Urgent
0 0 Urgent

You should look in to these different part of the code. This is tested on Your values. Used IF AND OR
=IF(AND(A2=0,B2=0),"URGENT",IF(OR(A2>0;B2<A2),"BLANKS",IF(AND(A2=0,B2>0),"TO ORDER",A2>0)))

the third condition :
If Column A greater than B and IF Column B greater than A than its “Blanks” in Column C
is useless since you already specified if a > 0 then it's blank.
the if syntax in excel is : =IF( condition ;IFTRUE ;IFFALSE)
to answer your question try this =IF(A2 > 0,"blanks",IF( B2 > 0,"to order","urgent"))

According to all the Conditions Mentioned above, this is your 100% working and tested solution:
=IF(A1>0,"Blanks",IF(AND(A1=0,B1>0),"To Order",IF(OR(A1>B1,B1>A1),"Blanks","Urgent")))

Related

Finding maximum value in group

I want to create a column of data that finds the largest value in column BD, based on individual values in Column B. I would have thought this equation would work! Anyone have any recommendations??
(first attempt)
=IF(BD3=0,0,SUMIFS($BD$3:$BD3,$B$3:$B3,B3,$BD$3:$BD3,MAX($BD$3:$BD3)))
(Second attempt)
=IF(BD3=MAXIFS($BD$3:$BD3,$B$3:$B3,B3),MAXIFS($BD$3:$BD3,$B$3:$B3,B3),0)
Projectid(B)
cumulative production(BD)
result I want()
1
20
0
1
60
0
1
70
70
2
0
0
2
0
0
3
20
20
4
0
0
5
0
0
6
0
0
7
10
0
7
40
0
7
60
60
this code should work:
=IF(MAXIFS($BD$1:$BD$12,$B$1:$B$12,A1)=BD1,MAXIFS($BD$1:$BD$12,$B$1:$B$12,B1),0)
If you have access to LAMBDA() function then can use below formula at one go.
=LET(a,BYROW(A2:A13,LAMBDA(x,MAXIFS(B2:B13,A2:A13,x))),IF(B2:B13=a,a,0))
Similar to SUMIFS you find MAXIFS
https://support.microsoft.com/en-us/office/maxifs-function-dfd611e6-da2c-488a-919b-9b6376b28883
Then just compare the MAX with the actual row value.
Edit based on your reply:
One way is to start with one operation in the cell first then it is easier to follow.
Your MAXIF should be like this (looking for the max in column B of those rows having the same value in column A as the value of current column A)
=MAXIFS(B$2:B$13;A$2:A$13;A2)
Then compare to B2
So, basically you got it, need just to adjust your second part of the MAXIFS :-)

How to find if a number in a row matches a number in a column, and then automatically offset the number in the column to another value

How to find if a number in a row matches a number in a column, and then automatically offset the number in the column to another value. For example:
Row 0 1 2 3 4 5
Answer x x x x x x
Column
0 100
1 340
2 500
3 266
4 455
5 800
So if "0" in the Row array matches "0" in the Column array, then show 340 and so on. I can to this with nested IF statements but is there an easier way if you have 100s of columns. Thanks

SUMPRODUCT with multiple criterias and empty cells

I have the following Excel spreadsheet:
A B C D E F G
1 Profit 1.Sales 2.Sale 3.sale
2 Product A 50 500 600 0 Product A 110
3 Product A 60 0 400 0 Product B 90
4 Prodcut A 20 0 0 0 Product C 130
5 Product B 90 800 0 500
6 Product C 80 0 0 400
7 Product C 50 300 750 200
8 ="" ="" ="" ="" =""
In Column A different products are listed. It can happen that the same products appear several times in the list. In Column B you can find the budgeted profit for each product and in Columns C:E the different sales of each product.
In Column G the sum of the profit of each product is shown in case the product has any sales. For example Product A has no sale in Row 4; therefore the sum of its profit is B2+B3 = 110.
I use the following formula to get the sum of the profit:
G2 = SUMPRODUCT($B$2:$B$7*(($C$2:$C$7>0)+($D$2:$D$7>0)+($E$2:$E$7>0)>0)*($A$2:$A$7=F2))
This formula works perfectly so far.
However, now I want to expand this formula to Row 8.
Row 8 does include =" " which causes a result of #VALUE! of the above formula.
How can I make this formula work despite the =" " in Row 8?
Try SUMPRODUCT() with two arguments:
=SUMPRODUCT($B$2:$B$8,(($C$2:$C$8>0)+($D$2:$D$8>0)+($E$2:$E$8>0)>0)*($A$2:$A$8=F2))

SUMPRODUCT with OR criterias

I have the following Excel spreadsheet:
A B C D E F G
1 Profit 1.Sales 2.Sale 3.sale
2 Product A 50 500 600 0 Product A 110
3 Product A 60 0 400 0 Product B 90
4 Prodcut A 20 0 0 0 Product C 130
5 Product B 90 800 0 500
6 Product C 80 0 0 400
7 Product C 50 300 750 200
8 ="" ="" ="" ="" =""
In Column A different products are listed. It can happen that the same products appear several times in the list. In Column B you can find the budgeted profit for each product and in Columns C:E the different sales of each product.
In Column G the sum of the profit of each product is shown in case the product has any sales. For example Product A has no sale in Row 4; therefore the sum of its profit is B2+B3 = 110.
I use the following formula to get the sum of the profit:
G2 = SUMPRODUCT($B$2:$B$8,(($C$2:$C$8>0)+($D$2:$D$8>0)+($E$2:$E$8>0)>0)*($A$2:$A$8=F2))
This formula works perfectly so far.
However, now I want to change this formula to only count in the Products that have a Sale > 500 so I modified the above formula to the following:
G2 = SUMPRODUCT($B$2:$B$8,(($C$2:$C$8>500)+($D$2:$D$8>500)+($E$2:$E$8>500)>500)*($A$2:$A$8=F2))
With this formula I get a value of 0 instead of 50 for Product A.
Where is my mistake in the formula?
Use Formula Auditing ► Evaluate Formula to examine what is happening at each step.
= SUMPRODUCT($B$1:$B$7,((($C$1:$C$7>500)+($D$1:$D$7>500)+($E$1:$E$7>500))>0)*($A$1:$A$7=F2))

Dynamic range that stops at the number before the last zero in a column

I have been trying to create a dynamic range within excel that would include all the rows in a column up until the last number before all the zeroes. For example here is the string of data.
0
0
350
500
107
0
200
500
27
736
0
0
0
0
In this case the numbers within the range that would be selected would be:
0
0
350
500
107
0
200
500
27
736
Any guidance would be greatly appreciated.
Thx
Assuming your data starts at A1 on Sheet1 you could define the range by using this formula in the "refers to" box
=Sheet1!$A$1:INDEX(Sheet1!$A:$A,MATCH(2,1/(Sheet1!$A:$A>0)))
that will include all the data up to the last >0 value
Assuming you have a header row and data starts in A2:
=INDEX(Sheet1!$A:$A,2):INDEX(Sheet1!$A:$A,(SUMPRODUCT(MAX((Sheet1!$A:$A<>0)*ROW(Sheet1!$A:$A)))))

Resources