Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / June 2007

Tip: Looking for answers? Try searching our database.

Excel Formula add if someone types PTO have it =0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Krsulic - 29 Jun 2007 19:08 GMT
I am trying to create what I would call an if/then formula in Excel 2003. If
someone types the letters PTO into a cell have tat equal zero in the formula.
I have a sum formula of a set of cells I want Excel to be able to add a zero
into the formula if someone types the letters PTO into the cell. My formula
works great until someone types letters into a cell then - of course -I get a
value error in the cell.
RJ - 29 Jun 2007 19:14 GMT
In your sum formula...i.e. =A5 + B5 + C5... you can insert an if statement
for the case where the value may not be a number for example PTO is written
in C5

=A5 + B5 +if(isnumber(C5),C5,0)

Hopefully this helps.

> I am trying to create what I would call an if/then formula in Excel 2003. If
> someone types the letters PTO into a cell have tat equal zero in the formula.
> I have a sum formula of a set of cells I want Excel to be able to add a zero
> into the formula if someone types the letters PTO into the cell. My formula
> works great until someone types letters into a cell then - of course -I get a
> value error in the cell.
John Krsulic - 29 Jun 2007 20:16 GMT
Thanks for your help
Here is my formula
=B11+D11+F11+H11+J11+L11+N11+P11+R11+T11+V11+X11+Z11+AB11+AD11+AF11+AH11+AJ11+AL11+AN11+AP11+AR11+AT11+AV11+AX11+AZ11+BB11+BD11+BF11+BH11
I need to make sure that if they write PTO in any cell it will tell the
formula it =the value of 0 so I do not get a name error. The suggestion
worked from below but only if it is typed in C5.

> In your sum formula...i.e. =A5 + B5 + C5... you can insert an if statement
> for the case where the value may not be a number for example PTO is written
[quoted text clipped - 10 lines]
> > works great until someone types letters into a cell then - of course -I get a
> > value error in the cell.
PCLIVE - 29 Jun 2007 19:15 GMT
Here's an example of how you could do that.

Original formula may be:
=A1+B1

But if A1 is PTO, then:
=IF(A1="PTO",0,A1)+B1

HTH,
Paul

>I am trying to create what I would call an if/then formula in Excel 2003.
>If
[quoted text clipped - 7 lines]
> get a
> value error in the cell.
John Krsulic - 29 Jun 2007 20:18 GMT
Thanks for your reply
Here is my formula
=B11+D11+F11+H11+J11+L11+N11+P11+R11+T11+V11+X11+Z11+AB11+AD11+AF11+AH11+AJ11+AL11+AN11+AP11+AR11+AT11+AV11+AX11+AZ11+BB11+BD11+BF11+BH11
I need to make sure that if PTO is typed into ANY CELL that is gives back
the value of 0 in the formula. Not just A1.

> Here's an example of how you could do that.
>
[quoted text clipped - 18 lines]
> > get a
> > value error in the cell.
Teethless mama - 29 Jun 2007 20:56 GMT
In A1:
=IF(OR(COUNTIF(B:IV,"PTO"),COUNTIF(A2:A65536,"PTO")),0,SUMPRODUCT(--(MOD(COLUMN(B11:BH11),2)=0),B11:BH11))

PTO can enter in any cells except cell A1, and cells B11:BH11

> Thanks for your reply
> Here is my formula
[quoted text clipped - 24 lines]
> > > get a
> > > value error in the cell.
PCLIVE - 29 Jun 2007 21:19 GMT
RJ's method should work for you.

=SUM(B11,D11,F11,H11,J11,L11,N11,P11,R11,T11,V11,X11,Z11,AB11,AD11,AF11,AH11,AJ11,AL11,AN11,AP11,AR11,AT11,AV11,AX11,AZ11,BB11,BD11,BF11,BH11)

Watchout for wrap-around.

Regards,
Paul

> Thanks for your reply
> Here is my formula
[quoted text clipped - 25 lines]
>> > get a
>> > value error in the cell.
Ragdyer - 29 Jun 2007 23:16 GMT
Yeah! ... but at the time, I didn't know how many cells he had to total.

This should be a little more concise:

=SUMPRODUCT(--(MOD(COLUMN(B11:BH11),2)=0),B11:BH11)

Signature

Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

> RJ's method should work for you.
>
[quoted text clipped - 36 lines]
>>> > get a
>>> > value error in the cell.
Ragdyer - 29 Jun 2007 23:23 GMT
Just don't tell Bob Phillips that I used a double unary!<bg>
Signature

Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

> Yeah! ... but at the time, I didn't know how many cells he had to total.
>
[quoted text clipped - 43 lines]
>>>> > get a
>>>> > value error in the cell.
Roger Govier - 30 Jun 2007 09:02 GMT
Hi Rick
> Just don't tell Bob Phillips that I used a double unary!<bg>
I think you might just get away with it.
Bob must be busy at the moment as he doesn't seem to be quite as active
in the NG currently .<g>

I'll keep quiet, as long as you don't mention when I use them!<g>

Signature

Regards

Roger Govier

> Just don't tell Bob Phillips that I used a double unary!<bg>
>> Yeah! ... but at the time, I didn't know how many cells he had to
[quoted text clipped - 47 lines]
>>>>> > get a
>>>>> > value error in the cell.
RagDyeR - 30 Jun 2007 20:43 GMT
It's a DEAL!<g>

Signature

Regards,

RD
-----------------------------------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
-----------------------------------------------------------------------------------------------

Hi Rick
> Just don't tell Bob Phillips that I used a double unary!<bg>
I think you might just get away with it.
Bob must be busy at the moment as he doesn't seem to be quite as active
in the NG currently .<g>

I'll keep quiet, as long as you don't mention when I use them!<g>

Signature

Regards

Roger Govier

> Just don't tell Bob Phillips that I used a double unary!<bg>
>> Yeah! ... but at the time, I didn't know how many cells he had to
[quoted text clipped - 54 lines]
>>>>> > get a
>>>>> > value error in the cell.
Ragdyer - 29 Jun 2007 19:20 GMT
Use the SUM() function!
It ignores text.

=Sum(A1:A110,B5:B15)
=Sum(A1,A33,B4,C2,C25,Z15)

Signature

HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

>I am trying to create what I would call an if/then formula in Excel 2003.
>If
[quoted text clipped - 7 lines]
> get a
> value error in the cell.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.