Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Excel 2007 - Formula To Compare Cell Text Only? 1

Status
Not open for further replies.

kjv1611

New member
Jul 9, 2003
10,758
US
I've been able to do this in VBA, but not in a formula, but I figure there's got to be a way.

Can anyone tell me how I'd go about comparing the "Text" values rather than "Formula" values of 2 cells?

For instance, I've got a worksheet on a regular basis where I compare 2 date fields. One column of dates includes the time; the other does not.

I found that in VBA, I could look at Range("A1").Text, for instance, and compare that. Is there a way to do something similar in just a formula?

Right now, my formula looks like this:
Code:
=IF(ISBLANK(H4)," ",IF(H4=E4,"Yes","No"))

Thanks for any references/suggestions.

--

"If to err is human, then I must be some kind of human!" -Me
 


Hi,
[tt]
=IF(ISBLANK(H4)," ",IF(INT(H4)=INT(E4),"Yes","No"))
[/tt]
Will compare the date part only.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Took me a minute to think about it, and Skip, I say that's brilliant! It works b/c Excel is looking at the numerical value of the date which will be 3513515.11315 or whatever - that's probably way off form a real date, I just hit a bunch of keys. [wink]

Thanks a bunch!

--

"If to err is human, then I must be some kind of human!" -Me
 



Yup. Right now in North Texas, its 40001.46458.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Oh, and I left out....

The INT part tells it to look at only the Integer value of the number, which will leave off the time portion, b/c the time always shows to the right of the decimal point. [smarty]

--

"If to err is human, then I must be some kind of human!" -Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top