## 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
Solved

# Formula not working on testing

Posted on 2013-11-14
184 Views
Hi,

I have attached a spreadsheet which has three tabs

(1) Control Sheet - these percentages are correct
(2) Raw Data
(3) My table

(1) Should = (3)

But the formula in (3) is pulling back incorrect numbers.

Can someone have a look at my formula and named ranges and see where i am going wrong.

Many thanks
Seamus
Test-Formula.xlsx
0
Question by:Seamus2626
• 4
• 4
• 4

LVL 23

Assisted Solution

NBVC earned 250 total points
ID: 39647729
I am not sure what you meant by "(1) Should = (3) " & "But the formula in (3) is pulling back incorrect numbers"?

what exactly is (3)?
0

Author Comment

ID: 39647775
3 is tab "S7 - Product Risk Scenario"

That should have the same results as my control sheet

Many thanks
0

Author Comment

ID: 39647792
To make it clearer, i moved my table from tab "S7 - Product Risk Scenario" to tab "control sheet" and you can see that the numbers are good, but the formula in my table in "S7 - Product Risk Scenario" should be doing the same thing and returning the same numbers

Thanks
Test-Formula.xlsx
0

LVL 50

Accepted Solution

barry houdini earned 250 total points
ID: 39647799
I think there are several things that are different, Seamus

One of the formulas uses Percentile.EXC and the other Percentile.INC......and CashFormula is defined over 12 columns, should it be one?

Also on the control sheet you are using the whole of column B whereas the other formula only references 101 rows. If you change the definition of CashFormula to be a single column, i.e.

=OFFSET('Input - D1'!\$W\$8,0,0,COUNT('Input - D1'!\$W:\$W))

and then change the Control sheet formula to this in C1 copied down

=PERCENTILE.EXC(B\$1:B\$101,D1)

then the two should get the same results, see attached

regards, barry

PS the formula in S7 sheet doesn't need MATCH if you are only matching with one value, this would get you the same results in this case

=PERCENTILE.EXC(IF(InputRange=2,CashFormula),'S7 - Product Risk Scenario'!D28)
Test-Formula-barry.xlsx
0

Author Comment

ID: 39647823
Hi Barry,

It must be over 12 columns as when the data is fully populated there will be 12 months of data.

But why would that make a difference, if theres no data, it should not affect the calculation?

Thanks
0

LVL 23

Expert Comment

ID: 39647850
It seems that your formula converts the blanks in CashFormula to 0's so it takes those into account.  So we need to correct for that.

Also, your column B:B in Control Sheet doesn't correspond to the data in S7 sheet....

And you use Percentile.Inc in one sheet and Percentile.EXC in the other...

try:

=PERCENTILE.EXC(IF(ISNUMBER(MATCH(InputRange,{2},0)),IF(CashFormula="","",CashFormula)),D28)
0

LVL 50

Expert Comment

ID: 39647858
....but the other columns are not blank, you have values in columns X and Y. Even if you delete the values in X and Y the array formula treats blanks as zeroes and so that distorts the Percentile Calculation - if you want to ignore blanks in the CashFormula range you need to amend the formula like this

=PERCENTILE.EXC(IF(InputRange=2,IF(CashFormula<>"",CashFormula)),'S7 - Product Risk Scenario'!D28)

That will work across a 12 column range, ignoring any blanks

regards, barry
0

LVL 23

Expert Comment

ID: 39647871
..which is what I said too... :)
0

LVL 50

Expert Comment

ID: 39647880
Sorry NB_VC, I didn't see your last reply when I posted....but I could say the same - I already pointed out the INC and EXC discrepancy in my earlier answer and that the 2 ranges were not equal!

regards, barry
0

LVL 23

Expert Comment

ID: 39647939
Sorry Barry, please don't take it the wrong way.... I was just confirming that we both said the same thing to re-enforce that the reason for the problem....
0

LVL 50

Expert Comment

ID: 39647977
Hey! No problem,

....and I've been sitting here all this time wondering what this calculation does

'S7 - Product Risk Scenario'!D28

The value in S7 minus another value......Doh! it's all the sheet name.........

regards, barry
0

Author Closing Comment

ID: 39647988
Lads youve both been a huge help, got all my underlying data sorted and it all works out

Thank you very much for your help and patience!

Seamus
0

## Featured Post

Question has a verified solution.

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

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
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 …