#1   Report Post  
Junior Member
 
Posts: 1
Post if function

I'm fairly new to excel. I have a problem with a formula that I need help on. Here is what I want to do.

If B2 is between 270 and 284 then return .013 in C2
If B2 is between 285 and 290 then return .135 in C2

I have more senereos for the same formula, but I'm sure you get the idea.

Any help would be appreciated!

Duncan Robert
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default if function

On Tuesday, October 30, 2012 12:29:23 PM UTC-5, Duncan Robert wrote:
I'm fairly new to excel. I have a problem with a formula that I need

help on. Here is what I want to do.



If B2 is between 270 and 284 then return .013 in C2

If B2 is between 285 and 290 then return .135 in C2



I have more senereos for the same formula, but I'm sure you get the

idea.



Any help would be appreciated!



Duncan Robert









--

Duncan Robert


Have a look at the help index for CHOOSE
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default if function

Hi Robert,

Am Tue, 30 Oct 2012 17:29:23 +0000 schrieb Duncan Robert:

If B2 is between 270 and 284 then return .013 in C2
If B2 is between 285 and 290 then return .135 in C2


try:
=IF(AND(B2=270,B2<=284),0.013,IF(AND(B2=285,B2<= 290),0.135,""))
or
=(AND(B2=270,B2<=284))*0.013+(AND(B2=285,B2<=290 ))*0.135


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 829
Default if function

"Duncan Robert" wrote:
Here is what I want to do.
If B2 is between 270 and 284 then return .013 in C2
If B2 is between 285 and 290 then return .135 in C2


And what if B2 is less than 270 or more than 290?

Perhaps:

=IF(B2<270,0,IF(B2<285,0.013,IF(B2<=290,0.135,0))) )

Alternatively:

=LOOKUP(ROUND(B2,0),{0,270,285,291},{0,0.013,0.135 ,0})

ROUND(B2,0) takes care of the case B2 itself is not an integer. But it
might be the result you are looking for in that case.

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
User Function Question: Collect Condition in Dialog Box - But How toInsert into Function Equation? SteveM Excel Programming 1 January 3rd 08 03:45 PM
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Excel - User Defined Function Error: This function takes no argume BruceInCalgary Excel Programming 3 August 23rd 06 08:53 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM


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