Solved

Two array formulas give the same result

Posted on 2013-11-14
13
188 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
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 two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

746 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

13 Experts available now in Live!

Get 1:1 Help Now