Sort rows in a table in excel - excel

I have a large table with lots of "ORDERS" that go by numbers, each has multiple numbered "STEPS" (not necessarily equal in all orders). Each step has a "STATUS" which is one of two: "In process" or "completed".
I want to create a column that tracks each orders' step, and if they are all completed it will mark the order in all of it's rows as "FINISHED".
I tried formula Array but I can't think about something that worked.
EXAMPLE of a Desired outcome: (First row and column are belong to Excel's bar)
A
B
C
D
1
ORDER number
STEP number
STEP Status
ORDER STATUS
2
179
001
completed
FINISHED
3
179
002
completed
FINISHED
4
179
003
completed
FINISHED
5
179
004
completed
FINISHED
6
192
001
In process
7
192
002
completed
8
192
003
completed
9
192
004
In process
10
192
005
In process
11
202
001
completed
FINISHED
12
202
002
completed
FINISHED
13
202
003
completed
FINISHED
14
202
004
completed
FINISHED
15
202
005
completed
FINISHED
16
202
006
completed
FINISHED

In D2, formula should be =IF(COUNTIFS(A:A, A2, C:C, "completed") = COUNTIF(A:A, A2), "FINISHED", ""). Then copy that formula down column D.

Related

Calculate quantity using an unrelated field in dax

ID
001
002
REQ
ID ITEM QUANT
001 chips 20
002 chips 100
SCHEDULE
1 001 cleaning
1 002 normal
2 001 normal
2 002 remodel
3 001 normal
3 002 remodel
4 001 remodel
4 002 cleaning
item = corn chips
id_store
1
2
3
4
001
phase
cleaning
normal
normal
remodel
quant
0
20
20
5
002
phase
normal
remodel
remodel
cleaning
quant
100
5
5
0
I want to calculate a quant given a store phase. if the store is cleaning then its 0 quant, if remodeling then 5 quant else its the quant from requirements.
normally I would do this with a switch statement in dax but the phase data is not in my table. Please assist.
it turns out a simple switch statement looking at different tables works just fine.
Num Items :=
VAR T = sum(REQ[Quant])
RETURN
SWITCH(
TRUE(),
VALUES(SCHEDULE[PHASE]) = "cleaning", 0,
VALUES(SCHEDULE[PHASE]) = "remodeling", 5,
T
)

So I have 3 different columns in a excel file, what I need to is convert rows into columns by reference_number

So I have columns like this,
REF_NO
LCY_AMOUNT
TAG
001
200
NEGO
001
300
EXCH
001
350
POST
001
400
CONF
002
300
NEGO
002
400
EXCH
002
450
POST
002
500
CONF
What I need is Tag rows into columns like this
REF_NO
NEGO
EXCH
POST
CONF
001
200
300
350
400
002
300
400
450
500
So went with sumifs():
SUMIFS($B$3:$B$10,$A$3:$A$10,$A15,$C$3:$C$10,B$14)
And to produce the values in A15 and A16, you can check out unique().

Sorting to find maximum values

Here is a sample data table:
ID Number Test Type Score
001 A 81
001 A 75
001 A 93
001 B 62
001 B 87
001 B 82
002 A 91
002 A 83
002 B 94
002 B 97
What I want, in excel, is a return of the maximum score of each test type for each id number so it would look like this...
ID Number Test Type Score
001 A 93
001 B 87
002 A 91
002 B 97
Is that possible?
You can use MAXIFS(). On your second table, if you have the ID number and Test Types, in the C column you can do:
=MAXIFS(Sheet1!$C$2:$C$1000,Sheet1!$A$2:$A$1000,$A2,Sheet1!$B$2:$B$1000,$B2)
Where Sheet1 is your main table.

How match multiple column values and extract corresponding cell values in Excel

Sheet 1
Cust Visit DATE TIME
201 Day 1 11-Jul-17 11:15
201 Day 1 11-Jul-17 11:18
201 Day 1 11-Jul-17 11:20
201 Day 3 13-Jul-17 11:30
201 Day 3 13-Jul-17 11:32
201 Day 3 13-Jul-17 11:34
201 Day 7 17-Jul-17 11:20
201 Day 7 17-Jul-17 11:22
201 Day 7 17-Jul-17 11:24
201 Day 10 20-Jul-17 11:30
201 Day 10 20-Jul-17 11:32
201 Day 10 20-Jul-17 11:34
201 Day 14 24-Jul-17 11:15
201 Day 14 24-Jul-17 11:17
201 Day 14 24-Jul-17 11:19
202 Day 1 11-Jul-17 11:20
202 Day 1 11-Jul-17 11:22
................
.............
Sheet 2
RefC RVisit RDATE RefTIME
201 Day 1 11-Jul-17 9:30
201 Day 3 13-Jul-17 9:30
201 Day 7 17-Jul-17 9:30
201 Day 10 20-Jul-17 9:30
201 Day 14 24-Jul-17 9:30
202 Day 1 11-Jul-17 9:35
202 Day 3 13-Jul-17 9:35
...............
.....
First set of columns in excel show customer ID visit date and time for their survey participation.
The second set of columns shows the same Customer IDs shared by reference customers and similar details. Both are in the same sheet of excel.
We are to compare the time difference between reference customers and current customers of their visits. i.e. I want the values in RefTime column lined up next to the TIME column when refc matches Cust and Rvisit matches visit and date matches Rdate. The visits can be 3 per day or 2, it may vary.
I am unsure of how to approach this using formulas (INDEX & MATCH ?), and i am new to excel. Any help or intro to help me achieve this is appreciated.
Thanks !
Sorry for not being clear..For ex. I want the Reftime below 9.30 for Refc # 201
RefC RVisit RDATE RefTIME
201 Day 1 11-Jul-17 9:30
to appear next to TIME column for the first 3 rows of below as all details of above match (cust # wtih RefC , visit with Rvisit and date with Rdate).
Cust Visit DATE TIME
201 Day 1 11-Jul-17 11:15 9:30
201 Day 1 11-Jul-17 11:18 9:30
201 Day 1 11-Jul-17 11:20 9:30
It is still unclear what you want. I think you want a VLOOKUP but on more than one key. You can add a column in the Sheet2 to the left of the current columns - Assuming the RefC R Visit is Col B:
in Col 1, copy down =B1&B2 and then you can reference this column (and its subsequent columns) in a concatenated VLOOKUP: in the cell in SHeet1 where you want the result - assuming Cust Visit is column A, you put in, say Col E, =VLOOKUP(A2&B2,Sheet2!$A$2:$E$10000, 3, False)
The dollar anchors are important on the second parameter. The 3 in the third parameter says match column C, the False means look for exact matches. Wrap it in an IFERROR of IF(ISNA()) if you want to avoid non-found record errors.

Error in COUNTIFS function

I want to count how many vehicles are delayed more than 4 min on a given day according to a given departure (let's assume from 00:00 to 05:00).
This is a sample of the data:
A B C D
1 Line Day Departure Delayed (sec)
2 11 Weekday 02:30:00 120
3 11 Weekday 03:40:00 500
4 22 Weekday 01:45:00 10
5 44 Weekday 06:44:00 1000
6 55 Weekday 04:35:00 145
7 111 Saturday 14:40:00 450
8 111 Saturday 04:20:00 300
9 111 Saturday 20:20:00 220
10 111 Saturday 07:00:00 125
11 333 Sunday 09:15:00 700
I used a "TÆL.HVISER" function (Danish) or COUNT.IFS function to count the vehicles:
=TÆL.HVISER(A2:A11;"11";B2:B11;"Weekday";C2:C11;00:00:00>C2:C11>05:00:00;D2:D11;">240")
But it is not working. When I break this restriction into four restrictions, the individual restrictions are working but when I combine them it's not working.
I've laid out your data according to how I read your sample formula.
    
The EN-US formula in G4 is,
=COUNTIFS($A$2:$A$11, G$3, $B$2:$B$11, $F4, $C$2:$C$11, ">="&TIME(0, 0, 0), $C$2:$C$11, "<="&TIME(5, 0, 0), $D$2:$D$11, ">="&240)
Fill both right and down. I've use the TIME function so that a) real times could be referenced and b) it makes it easier to set to new values.
TÆL.HVISER, funktionen
Funktionen TID
It is the part
00:00:00>C2:C11>05:00:00
if you change it to two criteria like this
C2:C11;">00:00:00";C2:C11;"<05:00:00"
it will work. Here is the full formula:
=COUNTIFS(A2:A11;"11";B2:B11;"Weekday";C2:C11;">00:00:00";C2:C11;"<05:00:00";D2:D11;">240")

Resources