LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Find difference in min and max value

On Tue, 31 Mar 2009 08:57:02 -0700, DavidH56
wrote:

Hi,

I have a spreadsheet which has 17 columns of data with anywhere from 3,000
to 12,000 rows. I have a header with the autofilter on and sorted by column
F ascendingly. I would appreciate if someone could please create a macro
for me which would evaluate duplicates in column F and for each group of
these duplicates calculate the difference in the minimum and maximum values
which are located in column L and create a new column beside column L (which
would now be column M) to place the results to be located beside the last
similiar item of duplicates. There will be anywhere from 2 to 5 like items
from column F on each report.

Thank you in advance for your assistance.


Put this formula in M2 (or whichever row your data starts on)

=IF(AND(F2=F1,F2<F3),MAX(($F$2:$F$46=F2)*($L$2:$L $46))-MIN(IF($F$2:$F$46=F2,($F$2:$F$46=F2)*($L$2:$L$46), "")),"")

It's an array formula, so you have to enter with Control+Shift+Enter, not
just enter. Change the cell references to fit your data.

Fill down for all your data.

If your data is sorted by Col F then by Col L, you could simplify this
formula and make it faster. You didn't say that was the case, so I assumed
it was not.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
to find the difference between time Jogi Excel Worksheet Functions 2 May 17th 10 08:57 AM
Find Max Difference Sean Timmons Excel Worksheet Functions 5 December 29th 08 08:37 PM
Find rows with a common item and find or highlight difference jonnybrovo815 Excel Programming 2 February 27th 08 12:56 AM
Find the difference between the high & low value of a given set. Larry Excel Discussion (Misc queries) 3 January 27th 06 10:26 PM
FIND DIFFERENCE BETWEEN 50 AND <60 Sarath.Ch Excel Worksheet Functions 9 December 29th 05 01:09 AM


All times are GMT +1. The time now is 10:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"