![]() |
|
#1
|
|||
|
|||
![]()
I am trying to make this formula work.
9/11/12= c19 If(C19>=Z19,1,2) 01/18/12 =z19 C19 is more than Z19 so I should get a 1 but I get a 2. Does it have something to do with the fact that these are dates. If so any suggestions to make it work. |
#2
|
||||
|
||||
![]()
I suppose they are text looking like dates, not real dates
perhaps try the following Code:
=If(C19*1>=Z19*1,1,2)
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#3
|
|||
|
|||
![]()
Works like a charm, Thanks Pecoflyer, I appreciate the help!!!
|
#4
|
||||
|
||||
![]()
My pleasure, but do you know WHY it works?
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#5
|
|||
|
|||
![]()
Hi Pecoflyer,
I am not sure how it works. By taking the date times one change it to a number which allows it to be subtracted. Can you explain? Thanks in advance gbaker |
#6
|
||||
|
||||
![]()
In fact, when you perform an arithmetic operation on a text string it coerces it to a number. (obvioulsy "abcd" stays "abcd")
If you have a text string like 012345, any arithmetic operation involving this string will coerce it. In your example if you tried C19-Z19 it would work. OTOH,the comparison operator not being an arithmetic operator does not accomplish this, therefore one has to " cheat" by doing something like *1 or +0 or exp1, etc... Just be aware that in XL ( as in real life ![]() There are giveaways though. Left aligned cells are text and right aligned are numbers ( if not aligned manually) The ISTEXT function can help you also. If you want to know more, delve in the forums, you'll learn a lot
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#7
|
|||
|
|||
![]()
Hi Pecoflyer,
This has been very educational. I am always interested in learning more. I do use the forum whenever I need help and have always received great information. I've been working with Excel for over 20 years and still learn something new every day!!! Thanks again for you helo with this. gbaker |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Code to add dates | terricritch | Excel Programming | 10 | 11-08-2011 09:51 AM |
![]() |
Daria11 | Word VBA | 1 | 06-08-2011 06:54 PM |
![]() |
dev98 | Mail Merge | 2 | 05-06-2011 05:02 AM |
![]() |
Ziggy-R | Word | 10 | 09-28-2010 01:42 AM |
Adding dates | mkkram | Word | 0 | 11-27-2006 09:18 AM |