Hi all - today's problem is as follows:
I'm looking to return a value in Excel, based on data in a second workbook, subject to two conditions being met. Here's an example of the source data:
Criteria1 Criteria2 Value1 Value2
Apples A 10 100
Apples B 20 500
Apples C 5 10
Pears B 100 10
Pears C 50 20
Oranges A 3 10
Desired result:
Apples Pears Oranges
Value1 Value2 Value1 Value2 Value1 Value2
A 10 100 0 0 3 10
B 20 500 100 10 0 0
C 5 10 50 20 0 0
This is not the real data but hopefully gives an idea of what I'm trying to achieve. I'm just trying to get this clear in my head before putting it into code. The ultimate purpose is to autopopulate a predefined template from a number of Excel files generated by SAS.
So basically what I'm tring to achieve is a lookup (or similar), for example, look in the source data for the combination of criteria 1 and criteria 2, then return whichever value I want.
I can 'cheat' and create a new column based on concatenating the 2 criteria, but I don't want to touch the source data, only refer to it.
Hope this is clear, but if not just shout!
any ideas? Cheers, Chris
I'm looking to return a value in Excel, based on data in a second workbook, subject to two conditions being met. Here's an example of the source data:
Criteria1 Criteria2 Value1 Value2
Apples A 10 100
Apples B 20 500
Apples C 5 10
Pears B 100 10
Pears C 50 20
Oranges A 3 10
Desired result:
Apples Pears Oranges
Value1 Value2 Value1 Value2 Value1 Value2
A 10 100 0 0 3 10
B 20 500 100 10 0 0
C 5 10 50 20 0 0
This is not the real data but hopefully gives an idea of what I'm trying to achieve. I'm just trying to get this clear in my head before putting it into code. The ultimate purpose is to autopopulate a predefined template from a number of Excel files generated by SAS.
So basically what I'm tring to achieve is a lookup (or similar), for example, look in the source data for the combination of criteria 1 and criteria 2, then return whichever value I want.
I can 'cheat' and create a new column based on concatenating the 2 criteria, but I don't want to touch the source data, only refer to it.
Hope this is clear, but if not just shout!
any ideas? Cheers, Chris