How do I reformat a column of numeric data to have five rows between specific values when these specific values are spaced differently daily? - excel

example: * (loading bays are door assignments in a warehouse) in this column of data, Loading bay M1-1 has 3 rows until next loading bay value of 152, continuing downward from bay 152 to 151, there are 3 rows, same to bay 150, however from bay 150 to bay 149, there are 4 rows. I need to keep these bay numbers exactly 5 rows apart; (pattern being - BAY, 4 rows of data, BAY, 4 rows of data, BAY etc...) by inserting a blank row IF the next bay is LESS THAN 5 rows from the next bay.
I have a properly formatted template of each bay#, then 4 rows, then the next bay#
M1-1
5
0.00%
7
152
164
0.69%
38
151
0
0.00%
0
150
870
3.65%
17
136
149
2,438
10.22%
34
350
>>>>
correctly formatted column I created with index and match: How do I retrieve the 3 rows of data below the constantly changing row spacing and copy into my correctly formatted column.
M1-1
0
0
0
0
152
0
0
151
0
0
0
150
0
0
149
0
0
0
148
My question and problem can seemingly be solved by inserting a row based on EACH bay# and how many rows until the next door. This needs to be fluid as the values change daily sometimes 3 spaces, sometimes 4. My result MUST be 4 rows then the next bay.
Not sure if I am asking correctly and will greatly appreciate ANY recommendations.
I am by no means an Excel expert, I solve problems often in odd ways and this I just have not been successful.

Related

COUNTIFS with 2 different ranges and conditions

I have a table from which I need to count the ammount of specific numbers.
The table is dynamic and can have between 1 to 25 columns where the numbers are and then a code that starts with either a letter, 1 or 2. It has multiple rows too.
What I need is to have formulas to count the ammount of each specific number range if the code starts with the correct character as shown in the example image:
I can't manage to join the condition of the first range being between 2 numbers and the second range starting with a specific character.
The formula should look somewhat like this (count numbers between 200 and 299 with the code starting with 2):
=COUNTIFS(Table[[1]:[4]];">=200";Table[[1]:[4]];"<=299";Table[code];"2*")
letter 1 2 letter 1 2
100-199 200-299 200-299 2 1 1
300-399 400-499 400-499 3 3 3
500-599 600-699 2 2
700-799 2
1 2 3 4 code
139 307 165 B01
430 2CTE
581 703 PDC
312 354 528 746 GVM7
600 477 1OMC
299 425 413 2LP
231 666 420 433 1MLTQ
put this in F3 then copy over and down:
=IFERROR(SUMPRODUCT((Table[[1]:[4]]>=--LEFT(B3,3))*(Table[[1]:[4]]<=--RIGHT(B3,3))*(((ISNUMBER(F$2))*(LEFT(Table[[code]:[code]])=F$2&""))+((NOT(ISNUMBER(F$2)))*(NOT(ISNUMBER(LEFT(Table[[code]:[code]]))))))),"")
As per your comments to get everything between 400 and 499 and starts with 2:
=SUMPRODUCT((Table[[1]:[4]]>=400)*(Table[[1]:[4]]<=499)*(LEFT(Table[[code]:[code]])="2"))

how to change cells color per value next to it

I have the following set of 2 columns and n rows:
A B
1 44000 44000
2 2800 2730
3 17000 21160
4 1000 1046
5 700 0
6 1500 1249
7 300 107
8 1200 400
9 0 1400
10 4500 3582
11 0 280
I would like to create a Conditional Formatting rule for column B, so if value in any row exceeds the associated value in row A the cell becomes red: https://gyazo.com/83a45768c6952f5590448700059179ce
The problem with this approach is I have to modify every single cell and cannot apply the whole Rule for all cells in column B.
If I apply this rule to the set of cells in col A I receive: This type of reference cannot be used in Conditional Formatting formula: http://prntscr.com/feo3c0
The formula:
=$B1>$A1
The Applies to:
=$B:$B

Excel Rank Multiple Columns

I'm facing a issue with ranking in Excel particularly in regards to tie breaking. I tried several options but i guess they don't fit my issue. Its quite simple really, I'll explain:
The Data:
1 2 3 4 5 6 7 8 9 10
87 83 74 95 69 90 73 0 74 85
121 121 96 121 121 121 121 83 121 121
As you can see its easy for me to rank the first line (I'm working in columns instead of rows for the data). When i do a Rank Function gives the following result:
3 5 6 1 9 2 8 10 6 4
Which is correct.
The problem arises in the second line. There are ties because all of them reach the maximum of 121:
1 1 9 1 1 1 1 10 1 1
What i would like to do is take the first row as a tie breaker. So even if there is a tie the first line which was firstly text but now is a sequence from 1 to 10 could provide as secondary criteria to order the rank, thus giving the following ranking line:
1 2 9 3 4 5 6 10 7 9
Could one achieve this result?
Thank You very much in advance.
You need a helper row to break the tie. You can add a fraction of the first row to the second row to create a new row & use the new row to rank
A4 = A3+(A2/(MAX($A$2:$J$2)+1))
Using the MAX I ensure the fraction is less than 1 which is adequate to break ties in this case.
A6 = RANK(A4,$A$4:$J$4)
You can hide the helper row if you dont want to show it.

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).

Resources