Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Two array formulas give the same result

Posted on 2013-11-14
13
Medium Priority
?
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
LVL 50

Accepted Solution

by:
barry houdini earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

670 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