Solved

Two array formulas give the same result

Posted on 2013-11-14
13
189 Views
Last Modified: 2013-11-14
=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
0
Comment
Question by:Seamus2626
  • 6
  • 5
  • 2
13 Comments
 
LVL 50

Expert Comment

by:barry houdini
ID: 39647426
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
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39647427
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 Comment

by:Seamus2626
ID: 39647436
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
 
LVL 50

Expert Comment

by:barry houdini
ID: 39647454
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 Comment

by:Seamus2626
ID: 39647467
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 Comment

by:Seamus2626
ID: 39647503
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 39647504
Hello Seamus,

Did you intend to accept your own comment? Don't my answers together answer the question?

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
 

Author Comment

by:Seamus2626
ID: 39647543
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!
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 39647544
That still seems to be a "close request"......
0
 

Author Closing Comment

by:Seamus2626
ID: 39647552
Should be good now, thanks!
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 39647554
No problem, Seamus

Thank You!

regards, barry
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39647555
Yeah... thanks for noticing I commented! :)
0
 

Author Comment

by:Seamus2626
ID: 39647562
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now