Selecting data from a table based upon two conditions
Posted by Mike on October 29, 2001 4:47 AM
I think this must be able to be done, but i am having trouble coming up with the solution. I have a table of data with the columns as such:
CODE; DATE; DESCR; MARKET; SQTY; SVAL
I need to extract a figure from SALESQTY and SALESVAL based up looking up a combination of a specific string in the CODE column and a specific string in the MARKET column, and return this to a cell in another sheet. There can be up to 11 different MARKETs for each CODE, and this CODE is repeated on each row where the MARKET is different.
A sample is below:
CODE DATE DESCR MARKET SQTY SVAL
0140863737 7/12/95 SS Home 45 177
0140863737 7/12/95 SS Export 1 3
0140863737 7/12/95 SS Australia 4 6
0140863974 28/08/97 AW Home -10 -39
0140864083 4/07/96 FQ Home 27 110
0140864083 4/07/96 FQ Export 9 31
In the first CODE there are 3 markets. So basically I am looking to ask the question "What is the value in column SQTY where the CODE=X and the MARKET=Y ?" and the same for the value in SVAL.
If anybody can help me it would be greatly appreciated.