function on date

C

Curt

=TODAY() This is in K3 and formated to show day so it shows 13

=IF(("K3=13")123,"") This is in C 26

results #Value
Should be 123 or ""

Don't see what I have missed. I've run my gamet Anyone
Thanks
 
K

Ken Johnson

Formatting K3 does not affect the value excel uses in functions.
In C26 try...
=IF(DAY(K3)=13,123,"")

Ken Johnson
 
T

T. Valko

=TODAY() This is in K3 and formated to show day so it shows 13

The formatted *display* value is not the true underlying value of the cell.
If TODAY() is 2/13/2009 the *true underlying value* of the cell is 39857.

However, that is not why your formula is returning an error. It should be
written like this:

=IF(K3=13,123,"")

However, this will *always* return "" (blank) because K3 will *never* equal
13.

If you want K3 to display the day of the month use this:

=DAY(NOW())

Format as General or Number
 
R

Ron Rosenfeld

=TODAY() This is in K3 and formated to show day so it shows 13

=IF(("K3=13")123,"") This is in C 26

results #Value
Should be 123 or ""

Don't see what I have missed. I've run my gamet Anyone
Thanks

1. It would have been helpful if you had copied your formula into this post
instead of typing it. As written, your formula is invalid for several reasons.

It is missing a comma between the logical test, and the value_if_true
segment, assuming that is what you want to do.

2. "K3=13" is a string. It is a string because it is enclosed with quotation
marks.

The first argument of an IF function needs to be a logical test,
something that evaluates to TRUE or FALSE. A string does neither.

If your purpose is to determine if the contents of K3 is 13, that would
be properly expressed as: =IF(K3=13,value_if_true,value_if_false)

In your representation above, you have parentheses around the logical
test. Although it doesn't hurt anything, what was your reason for using them?
They seem to be superfluous.

3. You wrote that K3 is **formatted** to show the day so it shows 13. But you
are testing the *contents* of K3. Formatting a cell only changes what it
"shows". It does not change the *contents*. The full date is still being
returned by the TODAY() function.

There are two solutions.

1. Change your formula to read =if(day(k3)=13,123,"")

2. Correct your formula to read =if(k3=13,123,"")
and also change K3 to be =day(today()) (and you should also
format K3 to General).
--ron
 

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