Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Why does Excel say this formula contains an error?


I must be making a very moronic mistake here. ;)
Please tell me how the final formula listed contains an error.

If the following simple formula returns *W*
=P12

And the following *-LOOKUP-* formula -also- returns *W*
*=VLOOKUP(C53,Schedule_1,14)* <<(since this formula
-points- to cell p12)

And -*THIS*- formula works:
*=CONCATENATE(COUNTIF(P12,"W"),"-",COUNTIF(P12,"L"))*
<<(returning *1-0*)

Then why does Excel tell me that -*THIS*- formula contains an error?::

*=CONCATENATE(COUNTIF((VLOOKUP(C53,Schedule_1,14)) ,"W"),"-",COUNTIF((VLOOKUP(C53,Schedule_1,14)),"L"))*


--
HuskerBronco
------------------------------------------------------------------------
HuskerBronco's Profile: http://www.excelforum.com/member.php...fo&userid=4803
View this thread: http://www.excelforum.com/showthread...hreadid=559396

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Why does Excel say this formula contains an error?

=IF(ISNA(VLOOKUP(C53,Schedule_1,14)),0,IF(VLOOKUP( C53,Schedule_1,14)="W",1,0
))&"-"&
IF(ISNA(VLOOKUP(C53,Schedule_1,14)),0,IF(VLOOKUP(C 53,Schedule_1,14)="L",1,0)
)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"HuskerBronco"
wrote in message
news:HuskerBronco.2al1yo_1152288608.4699@excelforu m-nospam.com...

I must be making a very moronic mistake here. ;)
Please tell me how the final formula listed contains an error.

If the following simple formula returns *W*
=P12

And the following *-LOOKUP-* formula -also- returns *W*
*=VLOOKUP(C53,Schedule_1,14)* <<(since this formula
-points- to cell p12)

And -*THIS*- formula works:
*=CONCATENATE(COUNTIF(P12,"W"),"-",COUNTIF(P12,"L"))*
<<(returning *1-0*)

Then why does Excel tell me that -*THIS*- formula contains an error?::


*=CONCATENATE(COUNTIF((VLOOKUP(C53,Schedule_1,14)) ,"W"),"-",COUNTIF((VLOOKUP
(C53,Schedule_1,14)),"L"))*


--
HuskerBronco
------------------------------------------------------------------------
HuskerBronco's Profile:

http://www.excelforum.com/member.php...fo&userid=4803
View this thread: http://www.excelforum.com/showthread...hreadid=559396



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 418
Default Why does Excel say this formula contains an error?

HuskerBronco wrote:
Then why does Excel tell me that -*THIS*- formula contains an error?::

*=CONCATENATE(COUNTIF((VLOOKUP(C53,Schedule_1,14)) ,"W"),"-",COUNTIF((VLOOKUP(C53,Schedule_1,14)),"L"))*


Because you have asterisks in the formula :-) :-). Just kidding! But
please stop the "moronic" use of asterisks to provide emphasis or to
quote. It is confusing when you are asking about potential syntax
questions because an asterisk has a specific function in some Excel
formulas

Seriously, Excel probably complains because the 1st parameter of
COUNTIF() should be a range. VLOOKUP returns a value, not a range.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default Why does Excel say this formula contains an error?

HuskerBronco wrote...
....
If the following simple formula returns *W*
=P12

And the following *-LOOKUP-* formula -also- returns *W*
*=VLOOKUP(C53,Schedule_1,14)* <<(since this formula
-points- to cell p12)


No, it evaluates to the value of P12. It's not a reference to P12.

And -*THIS*- formula works:
*=CONCATENATE(COUNTIF(P12,"W"),"-",COUNTIF(P12,"L"))*
<<(returning *1-0*)


So this formula could return "1-0", "0-1" or "0-0" (the last of P12 is
neither W or L)? Far easier to use the following instead.

=CHOOSE(1+SUMPRODUCT((P12={"W";"L"})*{1;2}),"0-0","1-0","0-1")

Then why does Excel tell me that -*THIS*- formula contains an error?::

*=CONCATENATE(COUNTIF((VLOOKUP(C53,Schedule_1,14) ),"W"),"-",
COUNTIF((VLOOKUP(C53,Schedule_1,14)),"L"))*


Because COUNTIF only accepts single area range references as 1st
argument. To use VLOOKUP in this, try

=IF(NOT(ISNA(VLOOKUP(C53,Schedule_1,1))),
CHOOSE(1+SUM((VLOOKUP(C53,Schedule_1,14)={"W";"L"} )*{1;2}),"0-0","1-0","0-1"),
"'"&C53&"' not found")

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Why does Excel say this formula contains an error?


Thanks, so much, everybody for your quick response to my query.

I am VERY new to creating my own formulas, and it never occured to me
to use the ISNA function in this particular formula. Thanks, Bob.

And Harlan, the suggestion of using CHOOSE(1+SUM....) and
CHOOSE(1+SUMPRODUCT....) is also greatly appreciated. Those are
functions that I have no experience with, but I see how they can be
very helpful. There are other areas in my worksheet where they will
come in handy.

As for the asterisks, Joe...I don't know where they came from. I
didn't put them in my original post. I would like to ask a question
about something in your response, though. I understand when you say
that "the 1st parameter of COUNTIF() should be a range"....but why,
then, did the COUNTIF function work properly when I used the CELL
REFERENCE alone, as in the formula stated in my post?

Thanks, again, for your input and expertise.

=CONCATENATE(COUNTIF(P12,"W"),"-",COUNTIF(P12,"L"))


--
HuskerBronco
------------------------------------------------------------------------
HuskerBronco's Profile: http://www.excelforum.com/member.php...fo&userid=4803
View this thread: http://www.excelforum.com/showthread...hreadid=559396



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 418
Default Why does Excel say this formula contains an error?

HuskerBronco wrote:
As for the asterisks, Joe...I don't know where they came from. I
didn't put them in my original post.


Interesting. I suspect it is a function of your news reader ("writer")
and/or the format that you choose for posting (perhaps HTML instead of
plain text?). I no longer have the ability to look at the "raw" text
of your posting to see what you might have done. Suffice it to say:
try to avoid whatever it is that you did that caused the asterisks to
be inserted.

I understand when you say
that "the 1st parameter of COUNTIF() should be a range"....but why,
then, did the COUNTIF function work properly when I used the CELL
REFERENCE alone, as in the formula stated in my post?


A cell reference is a range of one cell. P12 is equivalent to the
range P12:P12. (But you cannot use P12:P12 where a single value is
expected.) VLOOKUP() returns a value, not a cell reference.

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
EXCEL ERROR - series formula is too long BobY Excel Worksheet Functions 3 April 3rd 23 10:55 AM
Convert Excel 4 formula to Excel 2003 format The Gasell Excel Worksheet Functions 3 April 12th 06 05:07 PM
Recurring Excel Formula error - multiple users affected! Rayo K Excel Discussion (Misc queries) 3 April 11th 06 02:22 PM
Excel 97 formula doesn't work in Excel 2003 [email protected] Excel Discussion (Misc queries) 2 April 4th 06 09:34 PM
Ignore error msgs in formula references gharden Excel Discussion (Misc queries) 4 June 17th 05 12:14 AM


All times are GMT +1. The time now is 11:15 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"