I have been creating an EXCEL macros to get the maximum values of 5 data fields with two column search criteria. I have already tried to simplify to optimize the macros, however I still find this method to be slow and taking too long to complete and are considering using VB instead to handle this. Any suggestions on how to handle this in VB. TIA.
My data looks something like below:
Column C Column D Column E Column F Column G Column H Column I
1
2 Max Max Max Max Max
3 CFName LPARName PathBusy ChgCnt %TotDely SyncST AsyncST
4 BA01C7 CP1A 20 0 0.1 20 180
5 CP1B 0 0 0 10 200
6 CP1C 0 0 0 15 130
7 CP1D 0 0 0 30 200
8 CP1E 0 0 0 10 150
9 CP1F 0 0 0 12 100
10 BA02C7 CP1A 20 0 0.1 20 180
11 CP1B 0 0 0 10 200
12 CP1C 0 0 0 15 130
13 CP1D 0 0 0 30 200
CP1E 0 0 0 10 150
CP1F 0 0 0 12 100
BCC1C1 CP1A 20 0 0.1 20 180
CP1B 0 0 0 10 200
CP1C 0 0 0 15 130
CP1D 0 0 0 30 200
CP1E 0 0 0 10 150
CP1F 0 0 0 12 100
BCC1C2 CP1A 20 0 0.1 20 180
CP1B 0 0 0 10 200
CP1C 0 0 0 15 130
CP1D 0 0 0 30 200
CP1E 0 0 0 10 150
27 CP1F 0 0 0 12 100
My search criteria are Column C and D to find the max values for Column E to I
I used the Array formula for the following range:
for Range("E4:E27") is {=MAX(IF((CF1OUT!C:C=$C$4)*(CF1OUT!D:D=D4),CF1OUT!L:L))}
F4:F27 {=MAX(IF((CF1OUT!C:C=$C$4)*(CF1OUT!D:D=D4),CF1OUT!M:M))}
G4:G27 {=MAX(IF((CF1OUT!C:C=$C$4)*(CF1OUT!D:D=D4),CF1OUT!X:X))}
H4:H27 {=MAX(IF((CF1OUT!C:C=$C$4)*(CF1OUT!D:D=D4),CF1OUT!Q:Q))}
I4:I27 {=MAX(IF((CF1OUT!C:C=$C$4)*(CF1OUT!D:D=D4),CF1OUT!R:R))}
I have attached herewith the sample output worksheet and data.
Bookmarks