Formula to find matching row value in multiple columns - excel

I need a formula that would look in columns Jan, Feb & Mar to see if of the three months two months contained a 0, then in column 5 it would return the word win.
Store Jan Feb Mar Outcome
101 0
102 50 0
103 0 100
104 0 0 Win
105 0 0 Win

This should do the trick. (Placed in E2 and copied down)
=IF(COUNTIF(B2:D2,0)=2,"win","")
It counts how many zeroes are in columns B-D and if 2 then returns win

Related

Distinct Count Duplicate Value

I need help for distinct count for duplicate value and output required as follows.
If Column A's value is 28 the result should be unique1(Column E) Else if Column A's value is 29 then the result should be Column F(Unique2)
Code Product Quantity Weight Unique1 Unique2
28 Apple 9 100 1 0
28 Orange 9 100 1 0
28 Apple 9 100 0 0
29 Apple 9 200 0 1
29 Apple 10 100 0 1
29 Apple 10 100 0 0
28 Orange 9 200 1 0
I tried Mr.tigeravatar code and it is working fine, but I don't know how to add an if ... else condition for checking and output in a different column.
For validation try this code: paste it in cell G2 or whatever preceding columns in row 2.
=IF(OR(AND(A2=28,E2=1,F2<>1),AND(A2=29,E2<>1,F2=1)),"Correct","Incorrect")

Check Multiple Columns for the highest value

So say I had a table like this that has the score of 3 different teams for the week.
Day Team1 Team2 Team3
Mon 5 2 2
Tue 0 7 7
Wed 6 3 2
Thu 0 0 1
Fri 13 6 5
I want a formula that can find the highest score for the day and mark it on a identical table with a value of 1 and mark the other teams 0.
If there are 2 values that are the highest I want them to both be marked 1.
There will never be day with all 0's
Using the data from the table above my other table would look like this.
Day Team1 Team2 Team3
Mon 1 0 0
Tue 0 1 1
Wed 1 0 0
Thu 0 0 1
Fri 1 0 0
I have a working formula
=IF(AND(B2>=$C2,B2>=$D2,B2>=$E2),1,0)
I was just hoping there was a better way to write this formula, so that I can drag it across the teams and have it still work.
If I try to drag my formula now. I have to update the formula for each column. Sometimes I might have 20 + teams.
Any advice is appreciated.
Use MAX():
=IF(B2=MAX($B2:$D2),1,0)
Then copy/drag over and down.

How to get values with addons = the value without the addons in excel.

So below I have illustrated what I am looking to achieve in the end. I am wondering if it is possible to have the variation items (i.e. items with -LA or -LED) of the original item numbers (i.e. 1114 or bb2569/10) equal the same quantity in column B. The ending quantity should be based off of the original quantity from the original item number, i.e. 1114 or bb2569/10. This is only a small percentage of a much larger table of items and quantities.
This is what the code looks like now:
Item number Quantity
1114 5
1114-LA 0
1114-LED 0
225896 20
129239 17
225896-LA 0
225896-LED 0
114895 91
114895-LED 0
114895-LA 0
bb2569/10 42
bb2569/10-LA 0
bb2569/10 -LED 0
A22596 0
T-22265587 7
here is what i need it to look like in the end:
Item number Quantity
1114 5
1114-LA 5
1114-LED 5
225896 20
225896-LA 20
225896-LED 20
114895 91
114895-LED 91
114895-LA 91
bb2569/10 91
bb2569/10-LA 42
bb2569/10 -LED 42
A22596 0
T-22265587 7
Put this in C2 and Drag/Copy Down:
=SUMIF(A:A,TRIM(LEFT(A2,IFERROR(FIND("-L",A2)-1,LEN(A2)))),B:B)

Spotfire Consecutive Count

I am new to Spotfire so I hope that I ask this question correctly.
My table contains Corp_ID, Date and Flagged columns. The flagged column is either "1" or "0" based on if that Corp_ID had production on that date.
I need a custom expression that will return "0" if the flagged column is "0", BUT if the flagged column is "1" then I need it to return how many consecutive "1"s are in that string for that Corp_ID.
Corp_ID Date Flagged New Column
101 1/1/2016 1 1
101 1/2/2016 0 0
101 1/3/2016 1 4
101 1/4/2016 1 4
101 1/5/2016 1 4
101 1/6/2016 1 4
101 1/7/2016 0 0
101 1/8/2016 0 0
101 1/9/2016 1 2
101 1/10/2016 1 2
102 1/2/2016 1 3
102 1/3/2016 1 3
102 1/4/2016 1 3
102 1/5/2016 0 0
102 1/6/2016 0 0
102 1/7/2016 0 0
102 1/8/2016 1 4
102 1/9/2016 1 4
102 1/10/2016 1 4
102 1/11/2016 1 4
Thanks in advance for any assistance!
KC
This would be a lot easier to implement as part of the query you’re using to return the data, but if you have to do it in spotfire, I suggest this.
1- Create a hierarchy column containing [Corp_ID] and [Date] (Named ‘DateHr’)
2- Add a calculated column named ‘Concat Flags’ which concatenates all the previous flag values: Concatenate([Flagged]) OVER (Intersect(Parent([Hierarchy.DateHr]),allPrevious([Hierarchy.DateHr])))
3- Add a calculated column which will return the number of 0’s in the Concat Flags field (Named ‘# of 0s’): Len([Concat Flags]) - Len(Substitute([Concat Flags],"0",""))
4- Add a hierarchy column containing [Corp_ID] and [# of 0s] (Named ‘CorpHr’)
5- Add a calculated column to return your desired value: case when [Flagged]=1 then Sum([Flagged]) OVER (Intersect([Hierarchy.CorpHr])) else 0 end
Note: the above assumes you are working in Spotfire version 7.5. The syntax for using hierarchies in calculated columns differs slightly in earlier versions).

Excel table formulas to return blank

I have a table in excel with 2 columns, the E column is the running total the D column is the input value so normally it would be = E15+D16 however, i want the E column to return a blank if nothing is entered in the D column- what formula do I need?
1 Nov-23 Nov-30 1,230 1,230
2 Dec-01 Dec-07 130 1,360
3 Dec-08 Dec-14 416 1,776
4 Dec-15 Dec-21 124 1,900
5 Dec-22 Dec-28 102 2,002
6 Dec-29 Jan-04 83 2,085
7 Jan-05 Jan-11 95 2,180
8 Jan-12 Jan-18 88 2,268
9 Jan-19 Jan-25 102 2,370
10 Jan-26 Feb-01 130 2,500
11 Feb-02 Feb-08 311 2,811
12 Feb-09 Feb-15
13
14
15
16
17
18
19
20
21
22
=if(D16="","",E15+D16)
You dont even need the ISBLANK, just use empty quotes.
ISBLANK is what you're looking for.
In E16 =IF(ISBLANK(D16), "", E15+D16)
Use If and IsBlank in conjunction.
Do a check to see if the cell is blank, then depending on the result do the sum or the return blank. I don't have excel in front of me atm, but it should go something like this:
=if(ISBLANK(D16), "", E15+D16)
You can drag this down starting from the second cell in the column where this running total lives. The first one is obviously just the value from the adjacent cell.

Resources