'If two range criteria are met, copy a third cell and paste it to another sheet

I have a sheet called "Scores" where I have Column D and J with values from 1-9 in both columns.

In this same sheet I have a Column A with the corresponding name for that row (i.e Andrew).

What I need to do is basically a matrix with three possible ranges, which are 1-3, 4-6 and 7-9.

  • If D is within 1-3, and simultaneously J is 1-3, Column A for that row will go to a specific range of cells in another sheet called "Box",

  • if D is 1-3 and simultaneously J 4-6, Column A for that row will go to another range of cells in "Box",

  • If D is 1-3 and simultaneously J is 7-9 it will go to another range of cells in "Box".

  • The same thought process applies to all the different ranges (i.e D.3-5 with J.1-3, and so on)

I am attaching an example sheet for better clarification.

Example



Solution 1:[1]

I updated your Google Sheets in-place. In GS, this kind of job is straightforward with query().

=query(Scores!$A:$J, "select A where D >= 7 and D <= 9 and J >= 7 and J <= 9", 0)

Maybe someone will post Excel or VBA answer.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sangbok Lee