Link to home
Start Free TrialLog in
Avatar of Seamus2626
Seamus2626Flag for Ireland

asked on

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
Avatar of barry houdini
barry houdini
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of [ fanpages ]
[ fanpages ]

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.
Avatar of Seamus2626

ASKER

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
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
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
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!
ASKER CERTIFIED SOLUTION
Avatar of barry houdini
barry houdini
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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!


Sorry i thought i had pressed accept answer!
That still seems to be a "close request"......
Should be good now, thanks!
No problem, Seamus

Thank You!

regards, barry
Yeah... thanks for noticing I 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