# Two array formulas give the same result

=PERCENTILE.EXC(IF(OR(InputRange=1,InputRange=3,InputRange=4,InputRange=5,InputRange=6),CashFormula),'S7 - Product Risk Scenario'!D28)

=PERCENTILE.EXC(IF(OR(InputRange<>1,InputRange<>3,InputRange<>4,InputRange<>5,InputRange<>6,InputRange<>2),CashFormula),'S7 - Product Risk Scenario'!D28)

Hi,

these formulas are giving the same results but should be giving off very different results.

Is the formula okay?

Many thanks
Seamus
###### Who is Participating?

Commented:
Hello Seamus,

Changing the first formula as you suggest makes no difference. You should get exactly the same result with that one

=PERCENTILE.EXC(IF(ISNUMBER(MATCH(InputRange,{1,3,4,5,6},0)),IF(InputRange<>"",CashFormula)),'S7 - Product Risk Scenario'!D28)

...as with my original suggestion, i.e.

=PERCENTILE.EXC(IF(ISNUMBER(MATCH(InputRange,{1,3,4,5,6},0)),CashFormula),'S7 - Product Risk Scenario'!D28)

because the ISNUMBER(MATCH part will only find rows where InputRange explicitly matches 1,3,4,5 or 6, so checking that InputRange is not empty doesn't make any difference.

Did you enter the formulas with CTRL+SHIFT+ENTER, that's required in all cases?

regards, barry
0

Commented:
Hello Seamus,

As I mentioned elsewhere OR doesn't usually do as required in these formulas because it only gives a single result, so you will either get the whole of CashFormula or none of it. Try these instead

=PERCENTILE.EXC(IF(ISNUMBER(MATCH(InputRange,{1,3,4,5,6},0)),CashFormula),'S7 - Product Risk Scenario'!D28)

=PERCENTILE.EXC(IF(ISNA(MATCH(InputRange,{1,2,3,4,5,6},0)),CashFormula),'S7 - Product Risk Scenario'!D28)

Using MATCH means that with the first one your input range is matched against {1,3,4,5,6} and for rows that match any of those the relevant value from CashFormula is returned.

To reverse that so that those values are excluded you need to swich ISNUMBER to ISNA as per the second formula

regards, barry
0

IT Services ConsultantCommented:
Hi,

Limiting to just the first two clauses of the second formula, if a value is not equal to 1, or is not equal to 2, then it will be included.

Any value is not equal to 1 or not equal to 2.

The rest of the clauses are redundant.

BFN,

fp.
0

Author Commented:
Hi Barry, i switched the formula around

=PERCENTILE.EXC(IF(ISNA(MATCH(InputRange,{1,2,3,4,5,6},0)),CashFormula),'S7 - Product Risk Scenario'!D28)

The second formula returns and #NA

The first works fine

What are the reasons for an #NA in this type of formula?

Many thanks
0

Commented:
Hello Seamus,

I'd only expect you to get #N/A if you have #N/A values in CashFormula, is that possible? With the second version it returns the CashFormula value whenever InputRange doesn't match any of those numbers, even if InputRange is blank, I don't know if that causes an issue, perhaps try this version to exclude rows with blanks in InputRange

=PERCENTILE.EXC(IF(ISNA(MATCH(InputRange,{1,2,3,4,5,6},0)),IF(InputRange<>"",CashFormula)),'S7 - Product Risk Scenario'!D28)

regards, barry
0

Author Commented:
Hi Barry,

That has solved the #na error but im back to problem (1) its returning the same numbers as

=PERCENTILE.EXC(IF(ISNUMBER(MATCH(InputRange,{1,3,4,5,6},0)),CashFormula),'S7 - Product Risk Scenario'!D28)

Its confusing as the numbers in InputRange are very different, so when your looking for different numbers, the results should change dramatically but are exactly the same

Thanks
0

Author Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for Seamus2626's comment #a39647467

for the following reason:

I changed the top formula to

=PERCENTILE.EXC(IF(ISNUMBER(MATCH(InputRange,{1,3,4,5,6},0)),IF(InputRange<>"",CashFormula)),'S7 - Product Risk Scenario'!D28)

and the numbers are different as i expected

Many thanks!
0

Author Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for Seamus2626's comment #a39647467

for the following reason:

I changed the top formula to

=PERCENTILE.EXC(IF(ISNUMBER(MATCH(InputRange,{1,3,4,5,6},0)),IF(InputRange<>"",CashFormula)),'S7 - Product Risk Scenario'!D28)

and the numbers are different as i expected

Many thanks!

0

Commented:
That still seems to be a "close request"......
0

Author Commented:
Should be good now, thanks!
0

Commented:
No problem, Seamus

Thank You!

regards, barry
0

IT Services ConsultantCommented:
Yeah... thanks for noticing I commented! :)
0

Author Commented:
Hey FP, sorry my brain is fried at the minute from excel and im just plugging formula in! I do appreciate your comment :-)

Many thanks
Seamus
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.