简体   繁体   中英

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 (ie 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 (ie D.3-5 with J.1-3, and so on)

I am attaching an example sheet for better clarification.

Example

Thanks in advanced for the help.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM