View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Fred Smith Fred Smith is offline
external usenet poster
 
Posts: 623
Default ignore blank cells in function

First, you can simplify your If statement, because if A2 is not True, it will be
false -- you don't have to check for it.

So your statement: =IF(A2=True,"1",IF(A2=FALSE,"2"))
is the same as: =if(a2=True,"1","2")
is the same as: =if(a2,"1","2")
is the same as: =if(isodd(a1),"1","2")
and further reduced to: =if(isodd(weeknum(...)),"1","2")

To check a1 for data first, use:

=if(a1="","",if(isodd(a1),"1","2"))

--
Regards,
Fred


"Neil" wrote in message
...
I am using WEEKNUM to deliver the week of the year certain dates fall into,
with this i am using ISODD as each odd number will be marked as A in my
sheet and Even numbers as B to match different work teams. E.G 1 =A, 2=B,
3=A, 4=B etc.
But i want to format the whole page to do this so people can fill in the
details and it returns these details. but ISODD counts blank cells or 0 as a
false return so i have a sheet full of falses until the details are filled
in. I guess i am trying to ask how to not include the blank cells in the
function.
i have =ISODD(A1) then next cell =IF(A2=True,"1",IF(A2=FALSE,"2"))
any ideas anyone??