Fishboy
Well-known Member
- Joined
- Feb 13, 2015
- Messages
- 4,267
In Excel 2010 I have recently started swapping out referenced ranges for named ranges to account for additional data being added without formulas breaking, and on the whole this has been a success. I do however have a single formula that refuses to play ball using the named range, despite working fine using standard alpha-numeric references.
Here's what I have that works:
{=MAX(IF('Raw Purchase Data'!K2:K2102<>"Merchant",'Raw Purchase Data'!L2:L2102))}
Here are the definitions of the 2 named ranges above:
Range containing purely text values
Name: Purchase_SellerNameShort
RefersTo: ='Raw Purchase Data'!$K$2:INDEX('Raw Purchase Data'!$K:$K,MATCH("zzzz",'Raw Purchase Data'!$K:$K))
Range containing purely numeric values (except header)
Name: Purchase_TotalValue
RefersTo: ='Raw Purchase Data'!$L$2:INDEX('Raw Purchase Data'!$L:$L, MATCH(9.99E+307, 'Raw Purchase Data'!$L:$L), 1)
Here's what I tried amending the formula to using the names ranges:
{=MAX(IF(Purchase_SellerNameShort<>"Merchant",Purchase_TotalValue))}
The working formula returns the desired result of a the highest combined spend with a seller that isn't called "Merchant".
The non-working formula returns a result of #N/A
Can anyone think of a reason this would be? Are there problems with the dynamic ranges I have created that would cause it? Have I written the MAX / IF statement incorrectly?
Any help would be greatly appreciated.
Here's what I have that works:
{=MAX(IF('Raw Purchase Data'!K2:K2102<>"Merchant",'Raw Purchase Data'!L2:L2102))}
Here are the definitions of the 2 named ranges above:
Range containing purely text values
Name: Purchase_SellerNameShort
RefersTo: ='Raw Purchase Data'!$K$2:INDEX('Raw Purchase Data'!$K:$K,MATCH("zzzz",'Raw Purchase Data'!$K:$K))
Range containing purely numeric values (except header)
Name: Purchase_TotalValue
RefersTo: ='Raw Purchase Data'!$L$2:INDEX('Raw Purchase Data'!$L:$L, MATCH(9.99E+307, 'Raw Purchase Data'!$L:$L), 1)
Here's what I tried amending the formula to using the names ranges:
{=MAX(IF(Purchase_SellerNameShort<>"Merchant",Purchase_TotalValue))}
The working formula returns the desired result of a the highest combined spend with a seller that isn't called "Merchant".
The non-working formula returns a result of #N/A
Can anyone think of a reason this would be? Are there problems with the dynamic ranges I have created that would cause it? Have I written the MAX / IF statement incorrectly?
Any help would be greatly appreciated.