shyam131,
I've developed a working model based on the example you provided.
It includes formulas with the =DMAX and =DMIN functions.
I also included an example of an "extraction" option - where VBA code is attached to two separate macro buttons. One is for extracting the company(s) with the MAXIMUM Total, and the other for the MINIMUM Total. Optionally, the routines could be altered to have the data filtered-in-place instead of being extracted to a separate sheet.
In your description, you say you want the Max Total for all companies except for companies in segment Q. This was not a problem. However, I'm wondering if you want: a) the Max Total for "all" companies, or b) the Max Total for "each" company. The model I created is for "all" companies - as per your description, but it could be changed.
I could describe the steps involved in setting up these formulas and extraction process. However, it'll likely be easier for you to grasp if I email you a copy of the file.
For others who might also be interested in the file, just email me and I'll return the file.
Hope this helps.
Regards, ...Dale Watson dwatson@bsi.gov.mb.ca