max(if(range_criteria = criteria, value_criteria) ignoring criteria in the search

LlebKcir

Board Regular
Joined
Oct 8, 2018
Messages
219
to test, I simplified the formula to focus on 1 network with 4 sub-networks. the expected output is 4 different MAX values, one for each sub-network.

Code:
=MAX(IF(tOrlando[City/Network] = [Underground Network Name], tOrlando[Group]))

This is run within the tNetworkname table, so [Underground Network Name] Excel is removing the tNetworkName from that portion of the code. I find that irritating, but thats what Excel does.

In column [Underground Network Name] and in column tOrlando[City/Network] there are 4 sub-networks: Orlando - North, Orlando - South, Orlando - West, Orlando - East.

Only Orlando - North is reporting a value, but it is the wrong value. It is the Max for all sub-networks in the tOrlando[Group] column thus the Max(If is ignoring the criteria of [Underground Network Name] for the search.

edit to add: Current output is Orlando - North (wrong value), all others have a 0 as their output. All outputs are drastically off from the correct value.

1. Why is it ignoring the criteria value
2. How do I fix this?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Your [Underground Network Name] reference is to an entire column, not a specific cell - I suspect that was not your intention? For a cell in the current row, there should be an @ symbol at the start.
 
Upvote 0
You are correct, that was not my intent, sadly making that change did not help:

Code:
=MAX(IF(tOrlando[City/Network] = [@[Underground Network Name]], tOrlando[Group]))

The output is still the same, Orlando - North is a max, but it is the max for all under [Group] column, South, West, and East are all 0 value output.
 
Upvote 0
also to add, just in case there was any kind of typing difference between the value in the [Underground Net...] column matching values in tOrlando[City/Network] I did a copy/paste value into [Underground Net...] column to verify the data was identical.
 
Upvote 0
Corrected my error: forgot to shft+crtl+enter... duh.

Now I am getting expected results when hard coded, getting 0 when trying to use full referencing ;(

Code:
=max(if(IFERROR("t"&LEFT(tNetworkName[Underground Network Name],FIND(" ",tNetworkName[Underground Network Name])-1)&"[City/Network]","t"&(tNetworkName[Underground Network Name]&"[City/Network]")) = [@[Underground Network Name]], IFERROR("t"&LEFT(tNetworkName[Underground Network Name],FIND(" ",tNetworkName[Underground Network Name])-1)&"[Group]","t"&(tNetworkName[Underground Network Name]&"[Group]"))))

Now excel changes the above to:

Code:
=MAX(IF(IFERROR("t"&LEFT([Underground Network Name],FIND(" ",[Underground Network Name])-1)&"[City/Network]","t"&([Underground Network Name]&"[City/Network]")) = [@[Underground Network Name]], IFERROR("t"&LEFT([Underground Network Name],FIND(" ",[Underground Network Name])-1)&"[Group]","t"&([Underground Network Name]&"[Group]"))))

IFERROR("t"&LEFT([Underground Network Name],FIND(" ",[Underground Network Name])-1)&"[City/Network]","t"&([Underground Network Name]&"[City/Network]")

produces tNetwork[City/Network] so produces the same effect as tOrlando[City/Network] in the hard coded formula.

= [@[Underground Network Name]] works great thank you for reminding me to add the @

IFERROR("t"&LEFT([Underground Network Name],FIND(" ",[Underground Network Name])-1)&"[Group]","t"&([Underground Network Name]&"[Group]")

Produces the desired tNetwork[Group], just as tOrlando[Group] again when hard coded.

All values are now 0. Oh the joys of not being a programmer expected to code.
 
Upvote 0
so took it a step further, build a different set of data using concat to build out tNetwork[City/Network] and tNetwork[Group] and that is still producing zero
 
Upvote 0
Sorry, stupid IT here and their horrid proxy server caused upload issues for that post.

to finish the statement:

producing zero output.

Code:
{=MAX(IF(Sheet1!J2 = [@[Underground Network Name]], Sheet1!K2))}

The values on Sheet1 are just concatanated for "t", Network, [City/Network], or [Group] to generate the formula. Still zero.
 
Upvote 0
Code:
=Sheet1!J5
output =
Code:
tOrlando[City/Network]
Code:
=Sheet1!K5
output =
Code:
tOrlando[Group]
Code:
=INDEX(tNetworkName[Underground Network Name],5)
output =
Code:
Orlando - East

But when I attempt to wrap all of that together the output is 0

Code:
{=MAX(IF(Sheet1!J5 = INDEX(tNetworkName[Underground Network Name],5), Sheet1!K5))}

Why? That should build the correct formula

Code:
{=MAX(IF(tOrlando[City/Network] = INDEX(tNetworkName[Underground Network Name],5), tOrlando[Group]))}

Why are the two formulas not providing the same results?
 
Upvote 0
As I said earlier, you need INDIRECT to convert text to an actual range reference.
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top