Nested IF function

P

PWK

Hello All

=IF(ISBLANK(D2),"",TEXT(D2+3,"ddd"),IF(D2="Sun","Mon",D2)))

I am using this function in a worksheet to insert day of week. When
the day "Sun" occurs I want "Mon" to show in the cell instead (I get a
too many argument error). I get very confused with nested functions.
Thanks for your help.
 
P

PWK

is D2 a proper date or is it text?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software





- Show quoted text -

Don,
Thanks for your reply.
It is a date, in this case 11/13/2008
 
M

Mike H

Hi,

Try this and format as DDD

=IF(ISNUMBER(D2),MAX(WEEKDAY(2),WEEKDAY(D2)),"")


Mike
 
P

PWK

Don,
Thanks for your reply.
It is a date, in this case 11/13/2008- Hide quoted text -

- Show quoted text -

Let me add to this. My formula is in cell L2 my formula should read
=IF(ISBLANK(D2),"",TEXT(D2+3,"ddd"),IF(L2="Sun","Mon",L2))) as I said
I am confused.
 
D

David Biddulph

It sounds as if what you want is
=IF(ISBLANK(D2),"",IF(TEXT(D2+3,"ddd")="Sun","Mon",TEXT(D2+3,"ddd")))

The principle of nesting is pretty easy. You just replace an argument of a
function by another function.

You started with
=IF(ISBLANK(D2),"",TEXT(D2+3,"ddd"))

Then replace
TEXT(D2+3,"ddd")
with
IF(TEXT(D2+3,"ddd")="Sun","Mon",TEXT(D2+3,"ddd"))
 
R

Ron Rosenfeld

Hello All

=IF(ISBLANK(D2),"",TEXT(D2+3,"ddd"),IF(D2="Sun","Mon",D2)))

I am using this function in a worksheet to insert day of week. When
the day "Sun" occurs I want "Mon" to show in the cell instead (I get a
too many argument error). I get very confused with nested functions.
Thanks for your help.


Try:

=IF(ISBLANK(D2),"",TEXT(D2+3+(WEEKDAY(D2+3)=1),"ddd"))

--ron
 
D

Don Guillett

Please TOP post. A formula in cell L2 cannot change itself. You need to give
a better explanation.

Let me add to this. My formula is in cell L2 my formula should read
=IF(ISBLANK(D2),"",TEXT(D2+3,"ddd"),IF(L2="Sun","Mon",L2))) as I said
I am confused.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
Don,
Thanks for your reply.
It is a date, in this case 11/13/2008- Hide quoted text -

- Show quoted text -

Let me add to this. My formula is in cell L2 my formula should read
=IF(ISBLANK(D2),"",TEXT(D2+3,"ddd"),IF(L2="Sun","Mon",L2))) as I said
I am confused.
 
P

PWK

Let me add to this.  My formula is in  cell L2  my formula should read
=IF(ISBLANK(D2),"",TEXT(D2+3,"ddd"),IF(L2="Sun","Mon",L2))) as I said
I am confused.- Hide quoted text -

- Show quoted text -

Thanks, Don

You put me in the right direction. My successful formula was =IF
(ISNUMBER(D2),MAX(WEEKDAY(2),WEEKDAY(D2+3)),"") Every day is a
learning experience. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top