Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
For some reason =IF(OR(AS6="TODAY",YEAR(AS6)1900),TRUE,FALSE) is not working
together. AS6 is just one of the cells and I would like the cell to be formatted if the cell entry is either a date (obviously a recent one) or the word "Today". However, if I seperate the two, they work just fine. Any suggestions? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
The problem is that when the cell contains "Today" then the YEAR() function
returns a #VALUE! error and causes the formula to error. Since you're just returning a Boolean you can don't need the IF. Try it like this: =OR(AS6="TODAY",YEAR(N(AS6))1900) -- Biff Microsoft Excel MVP "Anurag" wrote in message ... For some reason =IF(OR(AS6="TODAY",YEAR(AS6)1900),TRUE,FALSE) is not working together. AS6 is just one of the cells and I would like the cell to be formatted if the cell entry is either a date (obviously a recent one) or the word "Today". However, if I seperate the two, they work just fine. Any suggestions? |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
That worked out like a charm. What's the N() for?
And being new to this community, would you mind answering one adminstrative question: how can I rate your response? "T. Valko" wrote: The problem is that when the cell contains "Today" then the YEAR() function returns a #VALUE! error and causes the formula to error. Since you're just returning a Boolean you can don't need the IF. Try it like this: =OR(AS6="TODAY",YEAR(N(AS6))1900) -- Biff Microsoft Excel MVP "Anurag" wrote in message ... For some reason =IF(OR(AS6="TODAY",YEAR(AS6)1900),TRUE,FALSE) is not working together. AS6 is just one of the cells and I would like the cell to be formatted if the cell entry is either a date (obviously a recent one) or the word "Today". However, if I seperate the two, they work just fine. Any suggestions? |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
What's the N() for?
When the cell contains "Today" N prevents the YEAR function from returning an error. If the argument to N is a number it returns that number. If the argument to N is text it returns 0. The argument to the YEAR function must be a number otherwise it returns an error. So, when the cell contains "Today" N returns 0 as the argument to the YEAR function and the whole YEAR test then evaluates to FALSE: YEAR(N("Today"))1900 = YEAR(N(0))1900 = YEAR(0)1900 = 01900 = FALSE how can I rate your response? Well, I don't access these groups through the web interface as you have so I don't know exactly how that works. I do occasionally look around on the web interface and from what I can see there's a button at the bottom of the post window that asks if the post was helpful. I think you have to be a registered user and logged in to rate a post. Beyond that I don't really know! -- Biff Microsoft Excel MVP "Anurag" wrote in message ... That worked out like a charm. What's the N() for? And being new to this community, would you mind answering one adminstrative question: how can I rate your response? "T. Valko" wrote: The problem is that when the cell contains "Today" then the YEAR() function returns a #VALUE! error and causes the formula to error. Since you're just returning a Boolean you can don't need the IF. Try it like this: =OR(AS6="TODAY",YEAR(N(AS6))1900) -- Biff Microsoft Excel MVP "Anurag" wrote in message ... For some reason =IF(OR(AS6="TODAY",YEAR(AS6)1900),TRUE,FALSE) is not working together. AS6 is just one of the cells and I would like the cell to be formatted if the cell entry is either a date (obviously a recent one) or the word "Today". However, if I seperate the two, they work just fine. Any suggestions? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Comparison of alphanumeric string | Excel Discussion (Misc queries) | |||
Logical conditions... could somebody help me | Excel Discussion (Misc queries) | |||
comparison string VBA excell | Excel Discussion (Misc queries) | |||
How do I set up multiple logical conditions on one result cell | Excel Worksheet Functions | |||
Logical Test comparison using cell color | Excel Discussion (Misc queries) |