Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have to arrays of test strings. Values could be Low, medium or High in both
arrays. I need to count how many pairs of High values appear when only High has been selected for any row. In other words, when the same label has been assigned in both column, that's a valid instance I wanna count. here's an example: Array1 Low Medium High High Array2 High Medium High Medium There is just one pair of Highs (3rd), and therefore the returned value should be 1. Thanks, Stefano |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() smaruzzi wrote: I have to arrays of test strings. Values could be Low, medium or High in both arrays. I need to count how many pairs of High values appear when only High has been selected for any row. In other words, when the same label has been assigned in both column, that's a valid instance I wanna count. here's an example: Array1 Low Medium High High Array2 High Medium High Medium There is just one pair of Highs (3rd), and therefore the returned value should be 1. Thanks, Stefano Hi Stefano, If your arrays are on a worksheet, say Array1 is A1:A4 and Array2 is B1:B4, then use... ==SUMPRODUCT((A1:A4="High")*(B1:B4="High")) If your arrays are VB arrays then use... Dim lTally As Long Dim I As Long For I = 1 To UBound(Array1) If Array1(I) = "High" And Array2(I) = "High" Then Let lTally = lTally + 1 End If Next MsgBox lTally I have assumed your arrays are one dimensional. Ken Johnson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=COUNT(IF((A2:A5="High")*(B2:B5="High"),1))
Array formula you have to commit CtrlShiftEnter (not just enter) "smaruzzi" wrote: I have to arrays of test strings. Values could be Low, medium or High in both arrays. I need to count how many pairs of High values appear when only High has been selected for any row. In other words, when the same label has been assigned in both column, that's a valid instance I wanna count. here's an example: Array1 Low Medium High High Array2 High Medium High Medium There is just one pair of Highs (3rd), and therefore the returned value should be 1. Thanks, Stefano |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
macro | Excel Discussion (Misc queries) | |||
Need help setting the worksheet header/Footer margins based on string height? | Excel Discussion (Misc queries) | |||
List File Properties - Author | Excel Worksheet Functions | |||
Auto convert an alphanumeric string (CIS9638S) to numbers only? | Excel Worksheet Functions |