![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Posts: 210
|
Using the followiing SUMIF and COUNTIF functions I am able to get the # of occurences and the avg in relation to specific cells. How can I get largest and the smallest number in the same range?
dblVal = Application.SumIf(rngC, rng, rngD) ' - Application.SumIf(rngC, rng, rngB) dblCnt = Application.CountIf(rngC, rng) dblAvg = dblVal / dblCnt MsgBox dblAvg |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
max and min?
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Posts: 210
|
could you me an example using my scenario?
TIA |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
I don't know, depending on what range you want:
Application.WorksheetFunction.Max (rngD) Application.WorksheetFunction.Min (rngD)
__________________
Kind regards, Al Chara |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Apr 2002
Posts: 210
|
Thats just it. The range is dependent on the results of the COUNTIF function. Thus my problem.
|
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
I am getting lost in your variable named ranges. Can you give the actual cell ranges?
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|