Saturday, August 24, 2013

Google Spreadsheet How to pair data from two separate data ranges

Question:

( by AlexSFr )



Hello,
Ok, so I have a spreadsheet where employees are making transactions against a requistion number. One sheet keeps tract of the individual transactions which is entered either manually or via a form. Another sheet shows the current requisition which the employee is assigned to.
What I would like to do is pair the currently assigned requsition number of the employee to every transaction the employee made in the first sheet. Example:


Here is also an example spreadsheet:


If this could be done with a query where the combined data is on a third sheet, that would be fine as well.
Thanks in advance.

Solution:

Have a look at the following screenshot:




I have the following formula in Cell E2:

=arrayformula(if(C2:C="";"";vlookup(C2:C;'Sheet2'!A:B;{2}*sign(row(C2:C));false)))


I hope the above solution will help you, and if you need more help then please do comment below on this blog itself, I will try to help you out.


I also take up private and confidential projects:
If this blog post was helpful to you, and if you think you want to help me too and make my this blog survive then please donate here: http://igoogledrive.blogspot.com/2012/09/donate.html 

Thanks,

1 comment:

  1. Thanks Kishan, this is awesome. However, is it possible to have the data combined into a third sheet using only a single query formula? So in other words, without combining the data first in sheet 1, use a query to combine the two sets of data in a third sheet.

    ReplyDelete