Need Urgent Help 2 - Return Values based on Condition

uberathlete

Board Regular
Joined
Jul 11, 2007
Messages
117
Hi everyone. This is like a follow up to a question I posed earlier (http://www.mrexcel.com/board2/viewtopic.php?t=288093&highlight=) but is a bit different. I have the following worksheet:

Excel Workbook
ABCDEFGHI
1DateSymbolPriceVolumeDATESYMBOLPRICEVOLUME
201/04/2000CA2000F94.823126101/04/2000
301/04/2000CA2000G94.713516301/05/2000
401/04/2000CA2000H94.55500001/06/2000
501/04/2000CA2000M94.11450001/07/2000
601/04/2000CA2000U93.813126101/10/2000
701/04/2000CA2000Z93.613126101/11/2000
801/04/2000CA2001H93.423126101/12/2000
901/04/2000CA2001M93.333126101/13/2000
1001/04/2000CA2001U93.273126101/14/2000
1101/04/2000CA2001Z93.226590001/17/2000
1201/04/2000CA2002H93.173126101/18/2000
1301/04/2000CA2002M93.123126101/19/2000
1401/04/2000CA2002U93.073126101/20/2000
1501/04/2000CA2002Z93.023126101/21/2000
1601/05/2000CA2000F94.794799401/24/2000
1701/05/2000CA2000G94.644799401/25/2000
1801/05/2000CA2000H94.444799401/26/2000
1901/05/2000CA2000M93.994799401/27/2000
2001/05/2000CA2000U93.694799401/28/2000
2101/05/2000CA2000Z93.464799401/31/2000
2201/05/2000CA2001H93.34799402/01/2000
2301/05/2000CA2001M93.214799402/02/2000
2401/05/2000CA2001U93.154799402/03/2000
2501/05/2000CA2001Z93.14799402/04/2000
2601/05/2000CA2002H93.054799402/07/2000
2701/05/2000CA2002M934799402/08/2000
2801/05/2000CA2002U92.954799402/09/2000
2901/05/2000CA2002Z92.94799402/10/2000
Sheet1


I would like to fill columns G to I. The condition is that what should be in those columns correspond to the date in column F and must be for the symbol that has the highest volume (from column D). The data array to refer to is columns A to D, which are sorted by date.

So for example, for the date 01/04/2000, the symbol with the highest volume is CA2001Z, so the info in row 11 must be used and therefore must look like:

Excel Workbook
FGHI
1DATESYMBOLPRICEVOLUME
201/04/2000CA2001Z93.2265900
301/05/2000
401/06/2000
501/07/2000
601/10/2000
701/11/2000
801/12/2000
901/13/2000
1001/14/2000
1101/17/2000
1201/18/2000
1301/19/2000
1401/20/2000
1501/21/2000
1601/24/2000
1701/25/2000
1801/26/2000
1901/27/2000
2001/28/2000
2101/31/2000
2202/01/2000
2302/02/2000
2402/03/2000
2502/04/2000
2602/07/2000
2702/08/2000
2802/09/2000
2902/10/2000
Sheet1


If for a certain date, the volume is all the same for all symbols, then the symbol to use is the first symbol for that date. So in this case, for the date 01/05/2000 wherein all volumes are the same, the symbol to look at is CA2000F because it comes first before all of the other symbols. So, we must have:

Excel Workbook
FGHI
1DATESYMBOLPRICEVOLUME
201/04/2000CA2001Z93.2265900
301/05/2000CA2000F94.7947994
401/06/2000
501/07/2000
601/10/2000
701/11/2000
801/12/2000
901/13/2000
1001/14/2000
1101/17/2000
1201/18/2000
1301/19/2000
1401/20/2000
1501/21/2000
1601/24/2000
1701/25/2000
1801/26/2000
1901/27/2000
2001/28/2000
2101/31/2000
2202/01/2000
2302/02/2000
2402/03/2000
2502/04/2000
2602/07/2000
2702/08/2000
2802/09/2000
2902/10/2000
Sheet1


This must then be done for the ret of the dates. I hope this isn't too much of a request but any help woul be great. If you can recommend some sort of procedure or macro or anything it would be much appreciated. Thanks!
 
Ack! Aladin, faceofthegod, I really appreciate your suggestions but for some reason, the formulas don't work for certain cells. I don't know why. For certain cells, the second condition doesn't work. This is asking a bit much but it would be really really great if you could take a look at the sheet I'm using which has the full dataset. This is driving me nuts. :cry:

Would you post the bit of data for which the system fails?
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Ack! Aladin, faceofthegod, I really appreciate your suggestions but for some reason, the formulas don't work for certain cells. I don't know why. For certain cells, the second condition doesn't work. This is asking a bit much but it would be really really great if you could take a look at the sheet I'm using which has the full dataset. This is driving me nuts. :cry:

Would you post the bit of data for which the system fails?

Oh I would but Excel Jeanie only accepts up to 500 cells. :(
 
Upvote 0
Ack! Aladin, faceofthegod, I really appreciate your suggestions but for some reason, the formulas don't work for certain cells. I don't know why. For certain cells, the second condition doesn't work. This is asking a bit much but it would be really really great if you could take a look at the sheet I'm using which has the full dataset. This is driving me nuts. :cry:

Would you post the bit of data for which the system fails?

Oh I would but Excel Jeanie only accepts up to 500 cells. :(

Just 5 records where the formulas fail...
 
Upvote 0
Ack! Aladin, faceofthegod, I really appreciate your suggestions but for some reason, the formulas don't work for certain cells. I don't know why. For certain cells, the second condition doesn't work. This is asking a bit much but it would be really really great if you could take a look at the sheet I'm using which has the full dataset. This is driving me nuts. :cry:

Would you post the bit of data for which the system fails?

Oh I would but Excel Jeanie only accepts up to 500 cells. :(

Just 5 records where the formulas fail...

Ack! Aladin, faceofthegod, I really appreciate your suggestions but for some reason, the formulas don't work for certain cells. I don't know why. For certain cells, the second condition doesn't work. This is asking a bit much but it would be really really great if you could take a look at the sheet I'm using which has the full dataset. This is driving me nuts. :cry:

Would you post the bit of data for which the system fails?

Oh I would but Excel Jeanie only accepts up to 500 cells. :(

Just 5 records where the formulas fail...

Hi Aladin. I decided to show the whole sheet so that you could get a better idea of what it looks like. It's located here:

http://bakafool.bravehost.com/index3.htm

The first 4 columns is the data array.

If you look at the DATE column which is column F ...

- for 7/16/02 , the symbol is CA2004M . However, in the data array the first symbol for that date is CA2002N .

- for 2/23/06 , the symbol is CA2006M. However, in the data array the first symbol for that date is CA2006H .

There are actually some more errors in certain cells and the data array as well as columns F to I are longer but I cut it to save space. Those errors basically only occur if the whole data array is used or referred to by the formula. I hope this can be remedied.
 
Upvote 0
On your list that you sent i didn't see those dates those dates that you referenced, but try these revised formula's:

J2 down w/ Ctrl + shift + Enter

Code:
=MIN(IF(CODE(RIGHT(IF($D$1:$D$1522=MAX(IF($F2=$A$1:$A$1522,$D$1:$D$1522)),$B$1:$B$1522,"[")))=MIN(CODE(RIGHT(IF($D$1:$D$1522=MAX(IF($F2=$A$1:$A$1522,$D$1:$D$1522)),$B$1:$B$1522,"[")))),ROW($A$1:$A$1522)))

G2 to I2 copied accross and then down
Code:
=IF($J2=1,"",INDEX(C:C,$J2,1))
 
Upvote 0
...

If you look at the DATE column which is column F ...

- for 7/16/02 , the symbol is CA2004M . However, in the data array the first symbol for that date is CA2002N .
...

Just checked this date... The Max volume on this date (on your link) is:

33116

The first symbol that corresponds to this value on 7/16/02 is:

CA2004M
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,794
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top