Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Checking a range with IF

I'm writing an IF function that checks a column of dates (Sheet1!$A$2:$A$366)
to find the row with a particular date (C3) and do something based on other
values in that row. (The LOOKUP, MATCH, and INDEX functions aren't quite
right for what I need.)

My IF function looks something like this:
IF(Sheet1!$A$2:$A$366=C3,TRUE,FALSE)...For clarity, I'm omitting the actual
TRUE / FALSE results because my testing shows that, for whatever reason, my
conditional only tests TRUE for 1/3/07. If C3 is any other date, this
function returns false, even though every date in 2007 is represented in the
range Sheet1!$A$2:$A$366.

I've never encountered a problem like this, as it seems pretty
straightforward. Any ideas why this conditional is only true for one date in
the range?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Checking a range with IF

Try entering the formula as an array by hitting CTRL+SHIFT+ENTER
--
Brevity is the soul of wit.


"Rob J" wrote:

I'm writing an IF function that checks a column of dates (Sheet1!$A$2:$A$366)
to find the row with a particular date (C3) and do something based on other
values in that row. (The LOOKUP, MATCH, and INDEX functions aren't quite
right for what I need.)

My IF function looks something like this:
IF(Sheet1!$A$2:$A$366=C3,TRUE,FALSE)...For clarity, I'm omitting the actual
TRUE / FALSE results because my testing shows that, for whatever reason, my
conditional only tests TRUE for 1/3/07. If C3 is any other date, this
function returns false, even though every date in 2007 is represented in the
range Sheet1!$A$2:$A$366.

I've never encountered a problem like this, as it seems pretty
straightforward. Any ideas why this conditional is only true for one date in
the range?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Checking a range with IF

Thanks for the reply.

Doing this only seems to have changed the value that it returns TRUE
for...now it only returns true for 1/1/07.

"Dave F" wrote:

Try entering the formula as an array by hitting CTRL+SHIFT+ENTER
--
Brevity is the soul of wit.


"Rob J" wrote:

I'm writing an IF function that checks a column of dates (Sheet1!$A$2:$A$366)
to find the row with a particular date (C3) and do something based on other
values in that row. (The LOOKUP, MATCH, and INDEX functions aren't quite
right for what I need.)

My IF function looks something like this:
IF(Sheet1!$A$2:$A$366=C3,TRUE,FALSE)...For clarity, I'm omitting the actual
TRUE / FALSE results because my testing shows that, for whatever reason, my
conditional only tests TRUE for 1/3/07. If C3 is any other date, this
function returns false, even though every date in 2007 is represented in the
range Sheet1!$A$2:$A$366.

I've never encountered a problem like this, as it seems pretty
straightforward. Any ideas why this conditional is only true for one date in
the range?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Checking a range with IF

So what are you trying to do? It sounds like you want Excel to search for a
value in a column, and, if that value appears, then do a calculation. Is
that correct? If it is, try something like =IF(COUNTIF([range],"[your
criteria]")0,[do your calculation],[do nothing?]

Essentially: "IF the count of your criteria in the given range is greater
than one, THEN do the calculation, ELSE [not sure what your else clause would
be.]"

Does that do what you're trying to do?

Dave
--
Brevity is the soul of wit.


"Rob J" wrote:

Thanks for the reply.

Doing this only seems to have changed the value that it returns TRUE
for...now it only returns true for 1/1/07.

"Dave F" wrote:

Try entering the formula as an array by hitting CTRL+SHIFT+ENTER
--
Brevity is the soul of wit.


"Rob J" wrote:

I'm writing an IF function that checks a column of dates (Sheet1!$A$2:$A$366)
to find the row with a particular date (C3) and do something based on other
values in that row. (The LOOKUP, MATCH, and INDEX functions aren't quite
right for what I need.)

My IF function looks something like this:
IF(Sheet1!$A$2:$A$366=C3,TRUE,FALSE)...For clarity, I'm omitting the actual
TRUE / FALSE results because my testing shows that, for whatever reason, my
conditional only tests TRUE for 1/3/07. If C3 is any other date, this
function returns false, even though every date in 2007 is represented in the
range Sheet1!$A$2:$A$366.

I've never encountered a problem like this, as it seems pretty
straightforward. Any ideas why this conditional is only true for one date in
the range?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Checking a range with IF

If you're trying to find the row, maybe you could use:

=index(sheet1!$a$2:$a$366,c3)+row($a$2)-1

It kind of sounds like you'll want to use =index(match()).

Debra Dalgleish has some notes:
http://www.contextures.com/xlFunctions03.html (for =index(match()))



Rob J wrote:

I'm writing an IF function that checks a column of dates (Sheet1!$A$2:$A$366)
to find the row with a particular date (C3) and do something based on other
values in that row. (The LOOKUP, MATCH, and INDEX functions aren't quite
right for what I need.)

My IF function looks something like this:
IF(Sheet1!$A$2:$A$366=C3,TRUE,FALSE)...For clarity, I'm omitting the actual
TRUE / FALSE results because my testing shows that, for whatever reason, my
conditional only tests TRUE for 1/3/07. If C3 is any other date, this
function returns false, even though every date in 2007 is represented in the
range Sheet1!$A$2:$A$366.

I've never encountered a problem like this, as it seems pretty
straightforward. Any ideas why this conditional is only true for one date in
the range?


--

Dave Peterson
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
Duplicate Range Names by worksheet FlaAl Excel Discussion (Misc queries) 0 May 24th 06 05:14 PM
How do you Identify text as a named range in excel DMDave Excel Discussion (Misc queries) 6 May 7th 06 11:48 PM
VLookup Error in Part of a Named Range Dallas64 Excel Worksheet Functions 6 April 18th 06 02:13 PM
Cannot Expand Named Range - when size of the Range exceeds Snig Excel Discussion (Misc queries) 1 July 7th 05 01:46 PM
Checking ALL values in a range nospaminlich Excel Discussion (Misc queries) 13 February 10th 05 09:29 AM


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

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

About Us

"It's about Microsoft Excel"