Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bayanbaru
 
Posts: n/a
Default IF function for blank cell

My formula is C1=SUM(A1: B1). I want to use IF function. If A1 and B1 is
blank C1 should be blank. Right now it show C1=0
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chip Pearson
 
Posts: n/a
Default IF function for blank cell

Try

=IF(OR(A1="",B1=""),"",A1+B1)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"bayanbaru" wrote in
message
...
My formula is C1=SUM(A1: B1). I want to use IF function. If A1
and B1 is
blank C1 should be blank. Right now it show C1=0



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David McRitchie
 
Posts: n/a
Default IF function for blank cell

If the question was correct then that should be an AND
and you might have to use SUM if either A1 or B1 is empty

=IF(AND(a1="",B1=""),"",SUM(A1:B1))

sometimes people put a space into a cell or a null string simiar to what is
being entered into Cell C1 with ="", so you might have to consider
=IF(AND(TRIM(A1)="",TRIM(B1)=""),"",SUM(A1:B1))

if the cell is actual empty, tests true for =ISBLANK(A1), then would work for A1+B1
but a cell with a null string would fail with a #VALUE! error..
SUM will ignore text constants.

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Chip Pearson" wrote in message ...
Try

=IF(OR(A1="",B1=""),"",A1+B1)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"bayanbaru" wrote in
message
...
My formula is C1=SUM(A1: B1). I want to use IF function. If A1
and B1 is
blank C1 should be blank. Right now it show C1=0






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
macropod
 
Posts: n/a
Default IF function for blank cell

Hi bayanbaru,

If you only want to hide the zero values:
.. throughout a worksheet, you could use Tools|Options|View and uncheck the
zero values option
.. in a single cell or a range of cells, you could apply a custom format.

For the latter, you could:
.. use Format|Cells|Number to apply the formatting you want for *both* +ve
and -ve values (i.e. the formatting code must include a semi-colon (i.e.
';') to distinguish +ve and -ve values) , then
.. click 'Custom' and add a semi-colon to the end of the formatting code (eg
'#,##0.00_ ;-#,##0.00 ' becomes '#,##0.00_ ;-#,##0.00;')

Cheers


"bayanbaru" wrote in message
...
My formula is C1=SUM(A1: B1). I want to use IF function. If A1 and B1 is
blank C1 should be blank. Right now it show C1=0



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can function in one cell change value or function in another cell? me Excel Worksheet Functions 4 February 27th 06 01:04 PM
Function that Returns address of that cell? RayWolfDog Excel Worksheet Functions 2 February 15th 06 04:54 PM
Reading Cell Function??? roy.okinawa Excel Worksheet Functions 2 December 1st 05 11:29 PM
Function making cell really "empty" Arvi Laanemets Excel Worksheet Functions 2 January 31st 05 05:23 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 11:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"