View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default To leave a cell blank following an "IF" function

How about:
=IF(A1="a",1,IF(A1="b",2,IF(A1="c",3,"")))

But I think I'd use:
=IF(a1="","",if(A1="a",1,IF(A1="b",2,IF(A1="c",3," No match"))))

=====
Actually, I'd use data|validation for A1 that uses column A of that other sheet
as its list.

Debra Dalgleish explains how:
http://contextures.com/xlDataVal01.html

Then I'd put that other information in columns B and C of that other sheet, too:

Then I could use formulas like:

=if(a1="","",vlookup(a1,sheet2!a:c,2,false))
(in B1)

And
=if(a1="","",vlookup(a1,sheet2!a:c,3,false))
(in C1)

Debra also has notes for =vlookup():
http://contextures.com/xlFunctions02.html




abie26 wrote:

How can I leave a cell blank following a response to an "IF" function?
Because in Excel 2007, the default response in a cell is "FALSE" when I leave
a cell in question to the "IF" function blank. This is because I would like
to be able to leave those cells in question to the function as blank or not
depending on the data that I would like to show.

Example: [in cell B1: IF(A1="a",1,IF(A1="b",2,IF(A1="c",3)))] in this
example, B1 returns "FALSE" when I leave A1 blank but I would like it to be
able to remain blank and not show "FALSE". What I was thinking is that the
function for a dropdown menu would do the job but I cannot get it to work the
way I would like it to so I am using the "IF" function instead.

What I have now is a dropdown menu in A1 (from data in another Worksheet)
and when I select a certain data from this menu, I would like Excel to
automatically put corresponding data in cells B1 and B2. And the only way I
know how it can do what I want it to do is to use the "IF" function in B1, B2
etc... but there is a bit of data in criteria to the "IF" function that this
function returns an error because there are too many functions within this
function.

Hope this makes sense.


--

Dave Peterson