Spreadsheet: 759445d1639554227-need-3-formulas-to-count-and-find-max-amount-test
Sheet: Sheet1

Data Source |  |  |  |  |  | Result One |  |  | Result Two |  |  |  | Result Three
 |  |  |  |  |  | Need a formula to count if "Y" and "N" are in the same invoice.  Use row 7A to 9C as example: The invoice # 91617136 has different type "Y" and "N", so the count result is 2.  Use another example #91630244 in A11 to 12C, since C11 and C12 are the same type "N", so the count result is 1 |  |  | Based on column B and C, need to count how many invoices on column A |  |  |  | Based on the column J, K, L criterias, from column A6 to D38, which invoice has the [NAME] amount.
Billing Document | Billing Month | Finished  (Y)/(N) | Gross Amount |  |  | Billing Document |  |  | Column B | Column C | Column A |  |  |  |  |  | Billing Document | Distinct Count of Finished |  | Billing Month | Finished  (Y)/(N) | Distinct Count of Billing Document |  |  |  | Billing Document | Finished  (Y)/(N) | Sum of Gross Amount
91604849 | 2020-11 | Y | 772.2 |  |  |  | 1 |  | 2020-11 | Y | 6 |  |  |  |  |  | 91604849 | 1 |  | 2020-11 | N | 1 |  |  |  | 91617136 | N | 92058.97
91617136 | 2020-12 | N | 91836.97 |  |  | 91617136 | 2 | 2 | 2020-12 | N | 2 | 1 |  |  |  |  | 91617136 | 2 |  | 2020-11 | Y | 6
91617136 | 2020-12 | N | 222 |  |  | 91630243 | 1 | 1 | 2020-12 | Y | 1 | 1 |  |  |  |  | 91630243 | 1 |  | 2020-12 | N | 1
91617136 | 2020-12 | Y | 87008.67 |  |  | 91630244 | 1 | 1 | 2021-02 | N | 3 | 3 |  |  |  |  | 91630244 | 1 |  | 2020-12 | Y | 1
91630243 | 2021-02 | N | 9500 |  |  | 91633576 | 1 | 1 | 2021-03 | Y | 1 | 1 |  |  |  |  | 91633576 | 1 |  | 2021-02 | N | 3
91630244 | 2021-02 | N | 2375 |  |  | 91640435 | 1 | 1 | 2021-03 | N | 1 | 1 |  |  |  |  | 91640435 | 1 |  | 2021-03 | N | 1
91630244 | 2021-02 | N | 2375 |  |  | 91641881 | 1 | 1 | 2021-04 | N | 2 | 2 |  |  |  |  | 91641881 | 1 |  | 2021-03 | Y | 1
91633576 | 2021-02 | N | 1604.25 |  |  | 91653509 | 1 | 1 | 2021-05 | Y | 1 | 1 |  |  |  |  | 91653509 | 1 |  | 2021-04 | N | 2
91640435 | 2021-03 | Y | 8651.44 |  |  | 91653943 | 1 | 1 | 2021-05 | N | 1 | 1 |  |  |  |  | 91653943 | 1 |  | 2021-05 | N | 1
91641881 | 2021-03 | N | 834.75 |  |  | 91662929 | 2 | 2 | 2021-06 | N | 7 | 7 |  |  |  |  | 91662929 | 2 |  | 2021-05 | Y | 1
91653509 | 2021-04 | N | 833.4 |  |  | 91664641 | 1 | 1 | 2021-06 | Y | 5 | 5 |  |  |  |  | 91664641 | 1 |  | 2021-06 | N | 7
91653943 | 2021-04 | N | 2500 |  |  | 91667432 | 1 | 1 |  |  |  |  |  |  |  |  | 91667432 | 1 |  | 2021-06 | Y | 5
91662929 | 2021-05 | Y | 3127.92 |  |  | 91667434 | 1 | 1 |  |  |  |  |  |  |  |  | 91667434 | 1
91662929 | 2021-05 | N | 15898.86 |  |  | 91667436 | 1 | 1 |  |  |  |  |  |  |  |  | 91667436 | 1
91664641 | 2021-06 | N | 8924.529999999999 |  |  | 91667439 | 1 | 1 |  | N | 1 |  |  |  |  |  | 91667439 | 1
91667432 | 2020-11 | Y | 2163.28 |  |  | 91667441 | 1 | 1 | 2020-11 | Y | 6 |  |  |  |  |  | 91667441 | 1
91667434 | 2020-11 | Y | 4616.83 |  |  | 91667442 | 1 | 1 | 2020-12 | N | 1 |  |  |  |  |  | 91667442 | 1
91667436 | 2020-11 | Y | 372.49 |  |  | 91667443 | 1 | 1 | 2020-12 | Y | 1 |  |  |  |  |  | 91667443 | 1
91667439 | 2020-11 | Y | 11750.33 |  |  | 91667445 | 1 | 1 | 2021-02 | N | 3 |  |  |  |  |  | 91667445 | 1
91667441 | 2021-06 | Y | 531.97 |  |  | 91667447 | 1 | 1 | 2021-03 | N | 1 |  |  |  |  |  | 91667447 | 1
91667442 | 2021-06 | Y | 3277.17 |  |  | 91667449 | 1 | 1 | 2021-03 | Y | 1 |  |  |  |  |  | 91667449 | 1
91667443 | 2021-06 | Y | 1111.04 |  |  | 91667453 | 1 | 1 | 2021-04 | N | 2 |  |  |  |  |  | 91667453 | 1
91667445 | 2021-06 | Y | 2276.81 |  |  | 91667454 | 1 | 1 | 2021-05 | N | 1 |  |  |  |  |  | 91667454 | 1
91667447 | 2020-11 | N | 3813 |  |  | 91667455 | 1 | 1 | 2021-05 | Y | 1 |  |  |  |  |  | 91667455 | 1
91667449 | 2020-11 | Y | 791.1500000000001 |  |  | 91667456 | 2 | 2 | 2021-06 | N | 7 |  |  |  |  |  | 91667456 | 2
91667453 | 2021-06 | N | 381 |  |  | 91667457 | 1 | 1 | 2021-06 | Y | 5 |  |  |  |  |  | 91667457 | 1
91667454 | 2021-06 | N | 381 |  |  | 91667458 | 1 | 1 |  |  |  |  |  |  |  |  | 91667458 | 1
91667455 | 2021-06 | N | 1143
91667456 | 2021-06 | N | 48624
91667456 | 2021-06 | Y | 459
91667457 | 2021-06 | N | 16206
91667458 | 2021-06 | N | 8265
91667458 | 2021-06 | N | 8265