![]() |
Excel If statement that is supposed to return a "" instead returns a 0
I have a If Function that refers to another cell on a different sheet
in the same workbook the formula is If(QuerySheet!A1="","",QuerySheet!A1) In other words I check for a null string (empty string) if there is one it should return an empty string back, if not return the value of the cell. The first cell of the column returns a blank cell (empty string as it is suppose to) The next cell down returns a 0 instead of the empty string that is dictated by the formula. I went into format cells. Both are 'General'. However the "Sample" in one is empty the other has a 0 as a sample. I thought the sample might be just returning what ever is in the cell. So I take out the formula of the cell that is returning a 0 (which I dont' want). I click on format cells again and the sample given is now blank. I put in the formula again. It stiil returns the 0. grrrr..... It seems rather arbitrary. After giving up I completed the column. All cells worked as the formula dictated if there was a value. The referred to cells that were blank however returned arbitrarilly a 0 or "". All the referred to cells are formatted the same. All the cells that contain the functions are formatted General. However, some return 0 others return "". I see no difference. |
Excel If statement that is supposed to return a "" instead returns
I have a guess; it was predicated on the option to show zero values being on
a sheet-by-sheet basis, and after some testing, this does appear to be the case. I am guessing that the referenced cells that are returning 0 are in actuality 0, but that in tools-options-view, zero values has been unchecked. If this is the case, try changing the formula to: If(QuerySheet!A1=0,"",QuerySheet!A1) -- Kevin Vaughn "omalleyman" wrote: I have a If Function that refers to another cell on a different sheet in the same workbook the formula is If(QuerySheet!A1="","",QuerySheet!A1) In other words I check for a null string (empty string) if there is one it should return an empty string back, if not return the value of the cell. The first cell of the column returns a blank cell (empty string as it is suppose to) The next cell down returns a 0 instead of the empty string that is dictated by the formula. I went into format cells. Both are 'General'. However the "Sample" in one is empty the other has a 0 as a sample. I thought the sample might be just returning what ever is in the cell. So I take out the formula of the cell that is returning a 0 (which I dont' want). I click on format cells again and the sample given is now blank. I put in the formula again. It stiil returns the 0. grrrr..... It seems rather arbitrary. After giving up I completed the column. All cells worked as the formula dictated if there was a value. The referred to cells that were blank however returned arbitrarilly a 0 or "". All the referred to cells are formatted the same. All the cells that contain the functions are formatted General. However, some return 0 others return "". I see no difference. |
All times are GMT +1. The time now is 11:58 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com