IF statement issues

Microsoft Office excel 2007 home & stude...
August 2, 2010 at 02:00:07
Specs: Windows XP, intel core 2 duo, 3.5GB ram
Basically i've been trying to fix this excel sheet for my boss at work, for some reason the following formula:

won't work, there are around 8 versions of this same formula the only difference between them all is a cell number.
I've gone through the entire worksheet and can't for the life of me find out what is wrong, if someone could help it would be much appreciated.

regards, Joe

See More: IF statement issues

Report •

August 2, 2010 at 06:07:49
Imagine how much more help we could be if you told us "won't work" means.

Keep in mind that we can't see your spreadsheet from where we're sitting, so we are at a bit of a disadvantage.

Report •

August 3, 2010 at 06:48:12
Sorry yeah, didn't think to put any of that stuff.

Basically the formula is supposed to show the numbers of iphone app downloads for our company's app, the data is stored in one sheet (WData) and is displayed on another sheet (home screen). However, for some reason nothing is displayed on the home screen, all we get is a dash.

Report •

August 3, 2010 at 07:44:58

Three points:
The most likely reason for returning different data to that expected is the use of TRUE in the VLOOKUP function. If the data in column C on WData is not in strict alpha-numeric order, VLOOKUP returns the next largest value that is less than lookup_value. As it expects the data to be sorted in order, if it isn't you get a different row selected.

Try VLOOKUP($N$4,WData!$C$1:$JS$57,1,TRUE)
and see if it returns the same value as is in N4
If not, change TRUE to FALSE (no quotes) and see if you get the right value.

Change the formula to this:
=IF(ISNA(VLOOKUP($N$4,WData!$C$1:$JS$57,MATCH($A57&C$13,WData!$C$1:$CK$1,0),FALSE)),0,VLOOKUP($N$4,WData!$C$1:$JS$57, MATCH($A57&C$13,WData!$C$1:$CK$1,0),FALSE))

The range for the Match function, which is used to determine which row to return a value from does not match the range used by VLOOKUP.
VLOOKUP will work if the column to return data from is between columns C and CK, but not if the text from $A57&C$13 is in a column between CK and JS.

Without knowing what your data is like, I don't know which range is correct.
This corrects the formula for the larger range:
=IF(ISNA(VLOOKUP($N$4,WData!$C$1:$JS$57,MATCH($A57&C$13,WData!$C$1:$JS$1,0),FALSE)),0,VLOOKUP($N$4,WData!$C$1:$JS$57, MATCH($A57&C$13,WData!$C$1:$JS$1,0),FALSE))

I also note that
uses mixed absolute and relative addressing. This is likely what is intended, but I can't be sure.
Dragging your formula down a row will result in this:
Dragging your formula right one column will result in this:

Check that this is what is wanted when you drag and extend the formula to other cells.


Report •

Related Solutions

August 3, 2010 at 07:58:46
Hey thanks, it seems that answer number two worked. The formula is now returning the correct data. Thanks a bunch! great help!

Report •

Ask Question