I updated columns J:L to reflect what I believe the OP's expected resuts are.
This attempt needs a helper column-E. Paste the following into E1 and copy down (it's NOT an array formula) to E20.
Select cells A1:C12 and "Clear contents" - these apparently blank cells are not and are impacting the result. Do the same with A18:C20.
Copy the following formula to F1 and enter as an array formula (CTRL-SHIFT-ENTER):
Copy F1 across to G1:H1. Then copy F1:H1 down to F20:H20
The expected results are now in columns F:H
The attached spreadsheet has been updated per the above.
Bookmarks