Domanda

Background: I'm using Excel functions to parse a lot of data out, essentially creating a flexible pivot table. It sorts a lot of race timing data by car, etc. In this portion of the sheet, I'm searching for the minimum segment times for each car. The rest of the sheet avoids macros and VBA so I'd like to avoid that here.

Issue: My formula worked when there are no zeros, but sometimes there are zeros that I need to exclude. My array formula is pretty complicated, but the change I made that broke it is this:

OLD (working):

{=min(if(car_number = indirect("number_vector"), indirect("data_vector")))}

NEW (non-working):

{=min(if(and(car_number = indirect("number_vector"),not(0=indirect("data_vector"))), indirect("data_vector")))}

I am using INDIRECT() with this exact argument several times in the formula. However, in this particular instance (inside the NOT()), it returns #VALUE! instead of {data1;...;datan}. Please see the screencaps below.

Before evaluation:

https://lh3.googleusercontent.com/-L8akIeJU_MU/Ud3Lsl1c5mI/AAAAAAAAAEY/MfrwGRi_29k/w565-h338-no/before.PNG

After evaluation:

https://lh3.googleusercontent.com/-SQK3fc33fzo/Ud3LsqjeOQI/AAAAAAAAAEU/oAmcxtr6tFU/w563-h303-no/after.PNG

È stato utile?

Soluzione

I suspect that your AND function might be a problem - AND only returns a single result not an array of results as required, try using multiple IFs like this

=min(if(car_number = indirect("number_vector"),IF(indirect(data_vector)<>0, indirect(data_vector))))

Note that I also used <> rather than using NOT

Are data vector and number vector the same size and shape? (both vertical?) why are there quotes around one but not the other?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top