Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 124
Default How to return a number instead of true/false with an if function?

Please help
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 515
Default How to return a number instead of true/false with an if function?

=IF(your condition,1,2)
eg =IF(A1=B1,1,2) will return a 1 if TRUE, and a 2 if FALSE

--
HTH

Kassie

Replace xxx with hotmail


"charles" wrote:

Please help

  #3   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How to return a number instead of true/false with an if function?

Always elaborate on your issue in the message area (that big white space).
The subject line's just that, meant to be brief keynotes on your issue. It's
NOT your query. Elaborate by posting your formula or your formula attempts
and by describing details of what you have (your sheet set-up, sample data)
and what you want to do/happen

Anyway, here's 2 simple IF examples to groove you in its use ..

In B2: =IF(A210,"Yes","No")
B2 will return "Yes" if the check [A210] evaluates to TRUE, "No" if FALSE

In B2: =IF(A210,200,A2)
B2 will return the number 200 if the check [A210] evaluates to TRUE. It'll
return the value in A2 if FALSE

Above any good? hit the YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"charles" wrote:
Please help

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 108
Default How to return a number instead of true/false with an if function?

Hi Charles,

You have had a couple of good answers already.

In general, if a function or expression evaluates to TRUE/FALSE, you can
convert it to 1/0 by multiplying by 1.

So
=A1=4
will return TRUE or FALSE depending on the value entered in cell A1, and
=1*(A1=4)
will return 1 or 0 based on the value in cell A1

That means that you can write
=IF(A1=B1,1,0)
or
=1*(A1=B1)
to show 1 or 0 if A1=B1

Ed Ferrero
www.edferrero.com

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
If a value is found return a true/false lbeemer Excel Discussion (Misc queries) 4 December 3rd 08 10:30 PM
Search for 2 true arguments and return true or false David Excel Discussion (Misc queries) 3 July 15th 06 10:18 AM
Look up to return a true/false value WTG Excel Worksheet Functions 1 April 12th 06 04:14 PM
Function to return True/False if all are validated as True by ISNU Tetsuya Oguma Excel Worksheet Functions 2 March 15th 06 10:28 AM
How do I return True False SimonP Excel Worksheet Functions 1 January 31st 06 04:12 PM


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