A zero result

  • Thread starter Thread starter Tonya Marshall
  • Start date Start date
T

Tonya Marshall

I am very new to Excel and having to learn everything from a blank slate.
My friend gave me the following formula to calculate days of stay and it
works well except I would like to have something in the formula that if
the result is zero, then make it 1.
=DAYS360(A1,V1)
Thank you.
 
Hi Tonya..........

Wrap your formula in an IF statement, like

=IF(DAYS360(A1,V1)=0,1,DAYS360(A1,V1))

Vaya con Dios,
Chuck, CABGx3
 
I think I should have asked a bit more about the formula.
So adding =IF and then parenthesizing the formula, the =0,1, means then
zero=1?
I'm curious as to how the formula would read out in verbal language.
Thanks. The more I can learn about what I'm doing, hopefully the better
I will be able to make formulas.
Thanks,
Tonya Marshall
 
If the result of my formula = 0, set the answer to 1, if the result is not = 0,
show the answer of the formula


: I think I should have asked a bit more about the formula.
: So adding =IF and then parenthesizing the formula, the =0,1, means then
: zero=1?
: I'm curious as to how the formula would read out in verbal language.
: Thanks. The more I can learn about what I'm doing, hopefully the better
: I will be able to make formulas.
: Thanks,
: Tonya Marshall
:
: CLR wrote:
:
: > Hi Tonya..........
: >
: > Wrap your formula in an IF statement, like
: >
: > =IF(DAYS360(A1,V1)=0,1,DAYS360(A1,V1))
: >
: > Vaya con Dios,
: > Chuck, CABGx3
: >
: >
: >
: >
: > : >> I am very new to Excel and having to learn everything from a blank slate.
: >> My friend gave me the following formula to calculate days of stay and it
: >> works well except I would like to have something in the formula that if
: >> the result is zero, then make it 1.
: >> =DAYS360(A1,V1)
: >> Thank you.
: >>
: >
: >
:
 
Questions, questions. Sorry about the multiple post but questions keep
arising.
I copied the formula down the column and there is a column of results of
1 all the way down. Is there a way not to have any results until the
formula is actually calculated?
Thanks.
Tonya Marshall
 
Hi Tonya

a IF function has three elements the test, what happens if it's true & what
happens if it's false
=IF(test, true, false)

you can also nest IF functions within other IF functions for example
=IF(test,IF(test,true,false),IF(test,true,false))
here another IF is nested within both the true and false elements of the
original IF
(you can nest up to 7 IFs)

so to only show 1 when there's something in column A then nest the IF inside
another IF, e.g.
=IF(A1="","",IF(DAYS360(A1,V1)=0,1,DAYS360(A1,V1)))
this means if there's nothing in A1 show nothing
or
=IF(OR(A1="",V1=""),"",IF(DAYS360(A1,V1)=0,1,DAYS360(A1,V1)))
this means if there is nothing in A1 or nothing in V1 show nothing

Hope this helps
Cheers
JulieD
 
=IF(A1>0, IF(DAYS360(A1,V1)=0,1,DAYS360(A1,V1)), " ")
or
=IF(A1>0, MAX(1,DAYS360(A1,V1), " ")

You cannot learn Excel piecemeal; it is time for a book!

Best wishes
 
Thanks Bernard. I do have Excel 2002 for Dummies <g>, the Quick
Reference, and I'm going through it, but it doesn't get very specific
about formulas. Hopefully, I won't have to get too complicated. I'm
making a spreadsheet for about 6 people to use to enter data and I'm
trying to automate it as much as possible to make it as easy as
possible. The others that will be using it know even less than I do
about it, if that's possible.
Tonya
 
Back to the drawing board. I'm trying to keep a running total in column
Y using the data in Column X and have column Y blank until there's
data in Column X. I'm not doing so well. Here's my formula:
(My rows start with Row 3 as I have headings in all the columns)
IF(OR(X3="",Y2=""),"",SUM(X3,Y2))

If it's needed the Dates in Column A and Column V are the ones I use to
get days of stay in column X.

Thank you.
Tonya Marshall
 
One way:

Enter this in Y3, and drag down to copy:

=IF(X3<>0,SUM($X$3:X3),"")

--

HTH,

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


Back to the drawing board. I'm trying to keep a running total in column
Y using the data in Column X and have column Y blank until there's
data in Column X. I'm not doing so well. Here's my formula:
(My rows start with Row 3 as I have headings in all the columns)
IF(OR(X3="",Y2=""),"",SUM(X3,Y2))

If it's needed the Dates in Column A and Column V are the ones I use to
get days of stay in column X.

Thank you.
Tonya Marshall
 
It works, but when I copy it down it shows the last total all the way
down. I want column Y empty if there's nothing in Column X
 
=SUM($X$3:X3)
will copy the last total all the way down in my sheet.

=IF(X3<>0,SUM($X$3:X3),"")
Will leave column Y *empty* when column X is empty, or, if column X displays
a zero from your "=DAYS360(A3,V3)" formula.

Are you sure that you copied it exactly?
What exactly do you have in column X?
 
RagDyeR said:
=SUM($X$3:X3)
will copy the last total all the way down in my sheet.

=IF(X3<>0,SUM($X$3:X3),"")
Will leave column Y *empty* when column X is empty, or, if column X displays
a zero from your "=DAYS360(A3,V3)" formula.

Are you sure that you copied it exactly?
What exactly do you have in column X?

I copied and pasted your formula into Y3

This is the formula I have in Column V. It's set up so that if A and V
are the same date it returns a 1. The column below the last figure is blank.
=IF(OR(A3="",V3=""),"",IF(DAYS360(A3,V3)=0,1,DAYS360(A3,V3)))
 
The formula you're using in column X should make this slight revision work
in column Y:

=IF(X3<>"",SUM($X$3:X3),"")
 
Ragdyer said:
The formula you're using in column X should make this slight revision work
in column Y:

=IF(X3<>"",SUM($X$3:X3),"")

Thank you, RD, so much. It's perfect. :)
Tonya
 
Back
Top