I download a receipt report showing receipts with order numbers. Column A has type Sale and Credit. I wrote a IF statement in column E where it tells me that there is a sale that had a credit with the same order number, and if it did not it would say "No Credit". I am combining column A and B because there could be 50K rows in the report. Here it is.
Is this the most efficient formula?
Now the new problem I am having is I am adding "Auth" to the Type column. The IF statement choices are Auth/Sales/Credit if the order numbers have all three types for the same order number. Sale/Credit if if they have Sale/Credit only. The next one is Sale only for the same order number and then Auth only if it doesn't have any credit or sale, and then Auth/Sale. Here is the table. I sorted it to make it easier for someone to help me. My table won't be sorted.
Book1 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Type | Order | Amount | Col A & B | |||
2 | Sale | 314200 | 100 | Sale-314200 | Sale/Credit | ||
3 | Sale | 312800 | 200 | Sale-312800 | No Credit | ||
4 | Credit | 314200 | 300 | Credit-314200 | No Credit | ||
5 | Sale | 312900 | 400 | Sale-312900 | No Credit | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D2:D5 | D2 | =A2&"-"&B2 |
E2 | E2 | =IFNA(IF(MATCH(IF(A2="Sale","Credit-"&B2,"Sale-"&B2),$D$2:$D$5,0)>0,"Sale/Credit"),"No Credit") |
E3:E5 | E3 | =IFNA(IF(MATCH(IF(A3="Sale","Credit-"&B3,"Sale-"&B3),D3:D6,0)>0,"Sale/Credit"),"No Credit") |
Is this the most efficient formula?
Now the new problem I am having is I am adding "Auth" to the Type column. The IF statement choices are Auth/Sales/Credit if the order numbers have all three types for the same order number. Sale/Credit if if they have Sale/Credit only. The next one is Sale only for the same order number and then Auth only if it doesn't have any credit or sale, and then Auth/Sale. Here is the table. I sorted it to make it easier for someone to help me. My table won't be sorted.
Book1 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Type | Order | Amount | Col A & B | Result I Want | ||
2 | Sale | 312800 | 200 | Sale-312800 | Sale | ||
3 | Credit | 312900 | 500 | Credit-312900 | Sale/Credit | ||
4 | Sale | 312900 | 400 | Sale-312900 | Sale/Credit | ||
5 | Auth | 314200 | 100 | Auth-314200 | Auth/Sale/Credit | ||
6 | Sale | 314200 | 100 | Sale-314200 | Auth/Sale/Credit | ||
7 | Credit | 314200 | 300 | Credit-314200 | Auth/Sale/Credit | ||
8 | Sale | 315100 | 100 | Sale-315100 | Sale/Credit | ||
9 | Credit | 315100 | 200 | Credit-315100 | Sale/Credit | ||
10 | Auth | 318100 | 200 | Auth-318100 | Auth Only | ||
11 | Auth | 320100 | 500 | Auth-320100 | Auth/Sale | ||
12 | Sale | 320100 | 500 | Sale-320100 | Auth/Sale | ||
Sheet1 (2) |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D2:D12 | D2 | =A2&"-"&B2 |