Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ann ann is offline
external usenet poster
 
Posts: 210
Default if 200 and <300 formula

how do i do a if A1 200 and <300 return A1 otherwise return 0. i can't get
the logic to work
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,089
Default if 200 and <300 formula

=IF(AND(A1200,A1<300),A1,0)

Regards

Trevor


"Ann" wrote in message
...
how do i do a if A1 200 and <300 return A1 otherwise return 0. i can't
get
the logic to work



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 109
Default if 200 and <300 formula

Ann

=if(and(A1200,A1<300),A1,0)

is one way.

Good luck.

Ken
Norfolk, Va


On Jun 25, 4:18 pm, Ann wrote:
how do i do a if A1 200 and <300 return A1 otherwise return 0. i can't get
the logic to work



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default if 200 and <300 formula

One way is with two IF statements. logically reads:
If (A1200 then If A1<300 then A1, else 0), else 0)

=IF(A1200,IF(A1<300,A1,0),0)

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default if 200 and <300 formula

how do i do a if A1 200 and <300 return A1 otherwise
return 0. i can't get the logic to work


Everyone has given you the IF function method, so let me be different.<g

=A1*AND(A1200,A1<300)

Rick


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ann ann is offline
external usenet poster
 
Posts: 210
Default if 200 and <300 formula

thanks all, the first was the easiest and it works!

"Rick Rothstein (MVP - VB)" wrote:

how do i do a if A1 200 and <300 return A1 otherwise
return 0. i can't get the logic to work


Everyone has given you the IF function method, so let me be different.<g

=A1*AND(A1200,A1<300)

Rick

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default if 200 and <300 formula

Or even

=A1*(A1200)*(A1<300)

--
Regards

Roger Govier


"Rick Rothstein (MVP - VB)" wrote in
message ...
how do i do a if A1 200 and <300 return A1 otherwise
return 0. i can't get the logic to work


Everyone has given you the IF function method, so let me be
different.<g

=A1*AND(A1200,A1<300)

Rick



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default if 200 and <300 formula

Or even

=A1*(A1200)*(A1<300)


Yeah, I was going to post that with an explanation that understanding this
construction will be helpful in making use of such functions as SUMPRODUCT
later on; but I had to take care of something and couldn't get back to my
computer until just now.

Rick

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default if 200 and <300 formula

Yes Rick, I posted in haste and should have explained to the OP that the
tests
(A1200)
(A1<300)
would lead to a True or False result.
When Multiplied together, the True's would be coerced to 1's and the
False's to 0's

Hence
A1*TRUE*TRUE becomes A1*1*1 which returns the value in A1
If either (or both) of the tests is False, then we get 0.
A1*0*1 = 0
A1*1*0 = 0

As you rightly say, understanding this principle, does help with the
understanding of other functions such as Sumproduct.

--
Regards

Roger Govier


"Rick Rothstein (MVP - VB)" wrote in
message ...
Or even

=A1*(A1200)*(A1<300)


Yeah, I was going to post that with an explanation that understanding
this construction will be helpful in making use of such functions as
SUMPRODUCT later on; but I had to take care of something and couldn't
get back to my computer until just now.

Rick



  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default if 200 and <300 formula

Yes Rick, I posted in haste and should have explained to the OP that the
tests
(A1200)
(A1<300)
would lead to a True or False result.
When Multiplied together, the True's would be coerced to 1's and the
False's to 0's

Hence
A1*TRUE*TRUE becomes A1*1*1 which returns the value in A1
If either (or both) of the tests is False, then we get 0.
A1*0*1 = 0
A1*1*0 = 0


I was going to make the OP look it up and try to decipher it... in thinking
about it, it is better that the explanation be given directly as you did...
good job there.

Rick

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



All times are GMT +1. The time now is 05:02 PM.

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"