ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Returning a zero if there is no month given (https://www.excelbanter.com/excel-discussion-misc-queries/174006-returning-zero-if-there-no-month-given.html)

spudsnruf

Returning a zero if there is no month given
 
Hello,

I have a simple equation to just return a value for the month that a payment
was received.

=month(a1)

at the moment, where there is no date in a column, i seem to be still
getting a value of 1. What i need to do is to return a value of 0 if there is
no date of payment.

Thanks very much

Dave Peterson

Returning a zero if there is no month given
 
=if(a1="",0,month(a1))
is one way

=if(isnumber(a1),month(a1),0)
is another.



spudsnruf wrote:

Hello,

I have a simple equation to just return a value for the month that a payment
was received.

=month(a1)

at the moment, where there is no date in a column, i seem to be still
getting a value of 1. What i need to do is to return a value of 0 if there is
no date of payment.

Thanks very much


--

Dave Peterson

spudsnruf

Returning a zero if there is no month given
 


"Dave Peterson" wrote:

=if(a1="",0,month(a1))
is one way

=if(isnumber(a1),month(a1),0)
is another.



spudsnruf wrote:

Hello,

I have a simple equation to just return a value for the month that a payment
was received.

=month(a1)

at the moment, where there is no date in a column, i seem to be still
getting a value of 1. What i need to do is to return a value of 0 if there is
no date of payment.

Thanks very much


--

Dave Peterson


spudsnruf

Returning a zero if there is no month given
 
Perfect. Thank you very much.

"Dave Peterson" wrote:

=if(a1="",0,month(a1))
is one way

=if(isnumber(a1),month(a1),0)
is another.



spudsnruf wrote:

Hello,

I have a simple equation to just return a value for the month that a payment
was received.

=month(a1)

at the moment, where there is no date in a column, i seem to be still
getting a value of 1. What i need to do is to return a value of 0 if there is
no date of payment.

Thanks very much


--

Dave Peterson



All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com