Rank based on Sequence of dates in Spotfire - spotfire

I am new to Spotfire and would appreciate any help on this.
Here is a sample data i am working on...
Well_ID Date Oil_Rate
1 8/30/17 614.62
1 8/31/17 614.62
1 9/01/17 873.07
1 9/02/17 873.07
And I need Something like below
Well_ID Date Oil_Rate Rank
1 8/30/17 614.62 1
1 8/31/17 614.62 2
1 9/01/17 873.07 1
1 9/02/17 873.07 2
Can anyone help me with this? Thanks!

This simple Rank function should suffice:
Rank([Date],Month([Date]),[Well_ID])
Ranks the Dates by their month and by Well_ID. other columns can be added as well to Rank over.

Related

how to reference a specific cell in a formula if other cells match a specific value

Thanks so much for looking at my question! I am trying to create a formula that subtracts a specific value from another formula. However, that specific value may change.
Example:
A B C D
1 1 100 =(2000 - ( if A = 1, i want to subtract the C value where B =1))
1 2 250
1 3 310
1 4 .
2 1
2 2 =((2000 - ( if A = 2, i want to subtract the C value where B =1))
2 3
2 4
3 1
3 2
3 3
3 4
(A,B,C,D are the columns)
Hopefully this makes sense! I am trying to subtract the C value that goes along with the B1 value for each different A.
I was thinking an index match of some sort but wasnt exactly sure how to do that when the A's change. Thanks so much in advance for help!
INDIRECT or INDEX functions can help you. See this answer.
Would something like a nested if function work for you here? For example:
=IF(A2=1,IF(B2=1,2000-C2,"Enter calculation if B2<>1"),"Enter calculation if A2"<>1)
If this works, then you can simply copy/paste the function down the rows in column D.

Dynamically sort list based off associated values with tie-breaker values

I'm trying to sort students based off frequency of participation. I have a table that is automatically generated totaling up how often a student has participated in the last few days.
I want it to do 2 things that I can't figure out.
I want it to ignore students that are at 0 removing them from the resulting rankings.
The first number is most important but I want it to reference the next value in the result of a tie.
Short example of table:
Andy - 1 1 2 3
Brad - 0 1 2 3
Cade - 1 2 3 4
Dane - 1 1 1 2
Desired result:
Cade - 1
Andy - 1
Dane - 1
The tie-breaker isn't that important and I figure I can have conditional formatting to remove children at 0, but I still can't seem to figure it out.
The closest formulas I have found in my searching are:
=INDEX($A$10:$A$9,MATCH(ROWS($C$1:C1),$C$1:$C$9,0))
This one doesn't work because it returns #N/A for pretty much all students who are tied.
=IFERROR(INDEX($C$1:$C$9,MATCH(SMALL(NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),ROWS($C$1:C1)+SUM(--ISBLANK($C$1:$C$9))),NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),0)),"")
I had this formula that can handle ties but it needs to be OFFSET but I don't know how since it is an array formula. Also, with both these formulas it reverses the ranks with the lowest values at the top. If anyone could assist me I would greatly appreciate it. I'm doing this so that I can give all students a chance to participate equally.
Use a helper column. In that column put the following formula:
=IF(B1=0,"n/a",SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1)))))
This will return a single number based on the rankings.
Then in your output column use:
=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")
Then a simple VLOOKUP to return the first number:
=IF(I1<>"",VLOOKUP(I1,A:B,2,FALSE),"")

count the total counts of cell per days

I am trying to find out the total number of order made in a day.
My data is like this :-
Date | Time | Product | Unit Sold
7/24/2018 10:45:59 Fries 1
7/24/2018 16:45:59 Fries 1
7/25/2018 12:45:59 Fries 1
7/25/2018 11:45:59 Fries 1
7/25/2018 1:45:59 Fries 1
7/25/2018 1:45:59 Fries 1
Now here you can see the count of 7/24/2018 is 2 , 7/25/2018 is 4 ..
I can manually filter and select all column and just copy the count from bottom bar.
but the problem is I have calculate of about 3 months of about 10 different branches.
I did googled up and found out about COUNTIF . and here what I tried
=COUNTIFS(range,">="&date1,range,"<="&date2)
But it returns me #N/A
Can anyone help me on here?
What you are asking is very simple, and can done with a little focus.
Step 1: Make sure the dates in date column are in the same format as with your system date. If yes then move to step 2, if not, Select date column -> then goto Data tab in Excel ribbon -> Under data tools you will find Text to columns -> Click that and convert the Dates to your system date format. move to Step 2
Step 2:
The formuala you mentioned
=COUNTIFS(range,">="&date1,range,"<="&date2)
I am assuming is an example and real code should look something like this unless you are using Names for ranges
=COUNTIFS(A2:A7,">="&B9,A2:A7,"<="&B10)
OR a better version would be
=SUMIFS(D2:D7,A2:A7,">="&B9,A2:A7,"<="&B10)
since this formula will actually sum up the Unit Sold column instead of date column. Example attached in image below. Enjoy.
sumif and countif example image

Finding the interval between demands in an excel forecasting sheet

I want to find a way for Excel to automatically give me the following 'interval':
Month 1 2 3 4 5 6
Demand 1 0 0 1 0 1
'Interval' 0 0 0 3 0 2
The 'interval' shows the amount of months between the demands. Is this doable in some sort of way? I couldnt find a function in Excel to do this. Maybe there is a way in VBA? I need this for the CROSTON forecasting method.
Thank you in advance for your time and effort!
J. Rommers
Count the number of consecutive zeros in the row above and adjust. In B3 enter:
=IF(B2=0,0,COUNTIF($B$2:B2,"=0")-SUM($A$3:A3))
and copy across:
Assuming the 3 columns are A, B and C use:
=MATCH(1,Bn:B1,0)-1
where Bn its the n of C

Show sales figures over time per employee

Assume the following data:
day employee sales
1 a 0
1 b 10
1 c 10
2 a 5
2 b 7
2 c 10
3 a 3
3 b 3
3 c 5
I would like to have a chart with on the x-asis the days (1, 2, 3) and on the y-axis the number of sales. Each employee should have its own line, so they can be compared.
I am unable to get a chart like this. I expect to get 3 lines when selecting all data, but Excel returns 1 line per data-row instead. It does not, so to speak, group the sales by employee. How can I get the chart I want? Is it even possible?
Any help is greatly appreciated :-)
Have you tried a pivot table or pivot chart? Just drop your employee name in your row section, sum your sales, and I think that's what you're looking for.

Resources