Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
novice33
 
Posts: n/a
Default if date statement or formula

I am trying to create an If statement that would populate a 1 in another cell
by reading the date in the cell next to it. For example, in cell A2 I have
12/12/2005, I want cell B2 to populate with a 1 if there is a date. More or
less, every time a date is entered in Column A, I want Column B to have a 1
next to it. I would appreciate any help given.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default if date statement or formula

Dates are just numbers to excel.

Can you just check to see if that cell in column A is numeric?

=if(isnumber(a1),1,0)
or
=--isnumber(a1)

(The -- converts true/false to 1/0's.)

If you have other numbers in that column, maybe:

=IF(AND(ISNUMBER(a1),LEFT(CELL("format",a1),1)="D" ),1,0)
or
=--AND(ISNUMBER(A1),LEFT(CELL("format",A1),1)="D")
or even
=ISNUMBER(A1)*(LEFT(CELL("format",A1),1)="D")
(multiplying is enough to do that conversion)

novice33 wrote:

I am trying to create an If statement that would populate a 1 in another cell
by reading the date in the cell next to it. For example, in cell A2 I have
12/12/2005, I want cell B2 to populate with a 1 if there is a date. More or
less, every time a date is entered in Column A, I want Column B to have a 1
next to it. I would appreciate any help given.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default if date statement or formula

First enter this tiny UDF:

Function vba_isdate(r As Range) As Boolean
vba_isdate = IsDate(r)
End Function

Then in B1 enter:

=IF(vba_isdate(A1),1,"") and copy down
--
Gary's Student


"novice33" wrote:

I am trying to create an If statement that would populate a 1 in another cell
by reading the date in the cell next to it. For example, in cell A2 I have
12/12/2005, I want cell B2 to populate with a 1 if there is a date. More or
less, every time a date is entered in Column A, I want Column B to have a 1
next to it. I would appreciate any help given.

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave O
 
Posts: n/a
Default if date statement or formula

Following your example, the formula in B2 might be
=IF(A2<"",1,"")
This evaluates A2 and returns a 1 if the cell contains anything, and
returns a blank if A2 is blank.

  #5   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default if date statement or formula

If there will be nothing else in column A except either dates or a blank
cell, then this in B1 and copied down will do..

=IF(A10,1,"")

If column A could contain either TEXT or a date or blank, then this

=IF(AND(ISNUMBER(A1), A10),1,"")

If column A could also contain numbers, then only specific date ranges
"might" be identified....as just the number 1 can actually be formatted and
considered a "date"...



Vaya con Dios,
Chuck, CABGx3


"novice33" wrote in message
...
I am trying to create an If statement that would populate a 1 in another

cell
by reading the date in the cell next to it. For example, in cell A2 I

have
12/12/2005, I want cell B2 to populate with a 1 if there is a date. More

or
less, every time a date is entered in Column A, I want Column B to have a

1
next to it. I would appreciate any help given.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
date that updates itself daily, plus another formula please?? Ted Excel Worksheet Functions 2 November 26th 05 03:36 PM
formula to calculate future date from date in cell plus days Chicesq Excel Worksheet Functions 8 November 3rd 05 12:25 PM
Conditional formula date Ron Rosenfeld Excel Worksheet Functions 1 October 25th 05 03:12 PM
imported impromtu report date issue - fix by format or formula Todd F. Excel Discussion (Misc queries) 3 July 7th 05 09:57 PM
Need to use IF formula with a Date cell Eric Mc Excel Worksheet Functions 2 June 8th 05 12:38 AM


All times are GMT +1. The time now is 06:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"