Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi there.
How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Try this...
=IF(OR(A1={"apple","orange"}),1,2) Note: I left both of these singular even though you made 'apple' singular and 'oranges' plural. If you need that mixture, just add the 's' onto the end of 'orange'. The key is, put all the text you want the cell to match inside the curly braces, quoted and comma delimited. Rick "Storm" wrote in message ... Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Great! Not having to specify the reference cell "A1" at each instance is
efficient. Thanks for your time! "Rick Rothstein (MVP - VB)" wrote: Try this... =IF(OR(A1={"apple","orange"}),1,2) Note: I left both of these singular even though you made 'apple' singular and 'oranges' plural. If you need that mixture, just add the 's' onto the end of 'orange'. The key is, put all the text you want the cell to match inside the curly braces, quoted and comma delimited. Rick "Storm" wrote in message ... Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
What is a final number is let's say "56"? I would like this number to
trigger a dollar amount based on these range of numbers: Group 1 Total Est. Hourly Usage (10-30 people) = $50 Group 2 Total Est. Hourly Usage (40-50 people) = $100 Group 3 Total Est. Hourly Usage (60-70 people) = $150 Group 4 Total Est. Hourly Usage (80-90 people) = $200 Group 5 Total Est. Hourly Usage (100-110 people) = $250 Group 6 Total Est. Hourly Usage (120+ people) = $300 So if my final number is "56 people" then how do I write the formula to be able to work. Because the number may change each month. One month it may be "26 people"? So in basic words here is what I would like to say: "If field A1 is between 10 & 39 then put $50 in field A2. If field A1 is between 40 & 59 then put $100 in field A2. If field A1 is between 60 & 79 then put $150 in field A2. If field A1 is between 80 & 99 then put $200 in field A2. If field A1 is between 100 & 119 then put $250 in field A2. If field A1 is 120 and above then put $300 in field A2. I don't know if I am explaining this correctly, but I would sure appreciate some help. I am self taught so I don't know how to put this properly. Thanks for any assistance. G. Hunter |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
See your other post.
Regards Ken....................... "G Hunter" wrote in message ... What is a final number is let's say "56"? I would like this number to trigger a dollar amount based on these range of numbers: Group 1 Total Est. Hourly Usage (10-30 people) = $50 Group 2 Total Est. Hourly Usage (40-50 people) = $100 Group 3 Total Est. Hourly Usage (60-70 people) = $150 Group 4 Total Est. Hourly Usage (80-90 people) = $200 Group 5 Total Est. Hourly Usage (100-110 people) = $250 Group 6 Total Est. Hourly Usage (120+ people) = $300 So if my final number is "56 people" then how do I write the formula to be able to work. Because the number may change each month. One month it may be "26 people"? So in basic words here is what I would like to say: "If field A1 is between 10 & 39 then put $50 in field A2. If field A1 is between 40 & 59 then put $100 in field A2. If field A1 is between 60 & 79 then put $150 in field A2. If field A1 is between 80 & 99 then put $200 in field A2. If field A1 is between 100 & 119 then put $250 in field A2. If field A1 is 120 and above then put $300 in field A2. I don't know if I am explaining this correctly, but I would sure appreciate some help. I am self taught so I don't know how to put this properly. Thanks for any assistance. G. Hunter |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Use the OR function such as
=If(OR(A1="apple",A1="oranges"),1,2) -- Best Regards, Luke M "Storm" wrote: Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thank you Luke. I was hoping there was I way I didn't have to specify the
"A1" reference cell at each instance...but hey, it works! Thanks for your time. "Luke M" wrote: Use the OR function such as =If(OR(A1="apple",A1="oranges"),1,2) -- Best Regards, Luke M "Storm" wrote: Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Try one of these:
=IF(OR(A1="apple",A1="orange"),1,2) =IF(OR(A1={"apple","orange"}),1,2) C1 = apple C2 = orange =IF(OR(A1=C1,A1=C2),1,2) As an array formula** : =IF(OR(A1=C1:C2),1,2) ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER) -- Biff Microsoft Excel MVP "Storm" wrote in message ... Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#9
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
This is great! Thanks Biff!
"T. Valko" wrote: Try one of these: =IF(OR(A1="apple",A1="orange"),1,2) =IF(OR(A1={"apple","orange"}),1,2) C1 = apple C2 = orange =IF(OR(A1=C1,A1=C2),1,2) As an array formula** : =IF(OR(A1=C1:C2),1,2) ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER) -- Biff Microsoft Excel MVP "Storm" wrote in message ... Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#10
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Bill...
What if...using the array method, I do have a list but I only want a select few on that list? For example: C1 = apple; C2 = oranges; C3 = grapes. I want my logical test to match either apple or grape, can I use this method? I tried to edit the formula to show instead of =IF(OR(A1=C1:C2),1,2) I did =IF(OR(A1=C1,C3),1,2)For some reason, even if A1 = C3, it still returned 2. (note: when A1 = C1, it returned 1). Thanks "T. Valko" wrote: Try one of these: =IF(OR(A1="apple",A1="orange"),1,2) =IF(OR(A1={"apple","orange"}),1,2) C1 = apple C2 = orange =IF(OR(A1=C1,A1=C2),1,2) As an array formula** : =IF(OR(A1=C1:C2),1,2) ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER) -- Biff Microsoft Excel MVP "Storm" wrote in message ... Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#11
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
can I use this method?
Not without making it overly complicated! Array entered: =IF(OR(A1=T(OFFSET(C1:C3,{0,2},,))),1,2) D1 = 0 D2 = 2 =IF(OR(A1=T(OFFSET(C1:C3,D1:D2,,))),1,2) So, for practical purposes, I would not use these! -- Biff Microsoft Excel MVP "Storm" wrote in message ... Hi Bill... What if...using the array method, I do have a list but I only want a select few on that list? For example: C1 = apple; C2 = oranges; C3 = grapes. I want my logical test to match either apple or grape, can I use this method? I tried to edit the formula to show instead of =IF(OR(A1=C1:C2),1,2) I did =IF(OR(A1=C1,C3),1,2)For some reason, even if A1 = C3, it still returned 2. (note: when A1 = C1, it returned 1). Thanks "T. Valko" wrote: Try one of these: =IF(OR(A1="apple",A1="orange"),1,2) =IF(OR(A1={"apple","orange"}),1,2) C1 = apple C2 = orange =IF(OR(A1=C1,A1=C2),1,2) As an array formula** : =IF(OR(A1=C1:C2),1,2) ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER) -- Biff Microsoft Excel MVP "Storm" wrote in message ... Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#12
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Gocha! Thanks again Biff.
"T. Valko" wrote: can I use this method? Not without making it overly complicated! Array entered: =IF(OR(A1=T(OFFSET(C1:C3,{0,2},,))),1,2) D1 = 0 D2 = 2 =IF(OR(A1=T(OFFSET(C1:C3,D1:D2,,))),1,2) So, for practical purposes, I would not use these! -- Biff Microsoft Excel MVP "Storm" wrote in message ... Hi Bill... What if...using the array method, I do have a list but I only want a select few on that list? For example: C1 = apple; C2 = oranges; C3 = grapes. I want my logical test to match either apple or grape, can I use this method? I tried to edit the formula to show instead of =IF(OR(A1=C1:C2),1,2) I did =IF(OR(A1=C1,C3),1,2)For some reason, even if A1 = C3, it still returned 2. (note: when A1 = C1, it returned 1). Thanks "T. Valko" wrote: Try one of these: =IF(OR(A1="apple",A1="orange"),1,2) =IF(OR(A1={"apple","orange"}),1,2) C1 = apple C2 = orange =IF(OR(A1=C1,A1=C2),1,2) As an array formula** : =IF(OR(A1=C1:C2),1,2) ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER) -- Biff Microsoft Excel MVP "Storm" wrote in message ... Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#13
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You're welcome!
-- Biff Microsoft Excel MVP "Storm" wrote in message ... Gocha! Thanks again Biff. "T. Valko" wrote: can I use this method? Not without making it overly complicated! Array entered: =IF(OR(A1=T(OFFSET(C1:C3,{0,2},,))),1,2) D1 = 0 D2 = 2 =IF(OR(A1=T(OFFSET(C1:C3,D1:D2,,))),1,2) So, for practical purposes, I would not use these! -- Biff Microsoft Excel MVP "Storm" wrote in message ... Hi Bill... What if...using the array method, I do have a list but I only want a select few on that list? For example: C1 = apple; C2 = oranges; C3 = grapes. I want my logical test to match either apple or grape, can I use this method? I tried to edit the formula to show instead of =IF(OR(A1=C1:C2),1,2) I did =IF(OR(A1=C1,C3),1,2)For some reason, even if A1 = C3, it still returned 2. (note: when A1 = C1, it returned 1). Thanks "T. Valko" wrote: Try one of these: =IF(OR(A1="apple",A1="orange"),1,2) =IF(OR(A1={"apple","orange"}),1,2) C1 = apple C2 = orange =IF(OR(A1=C1,A1=C2),1,2) As an array formula** : =IF(OR(A1=C1:C2),1,2) ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER) -- Biff Microsoft Excel MVP "Storm" wrote in message ... Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#14
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=2-OR(A1="Apple",A1="Oranges")
Storm wrote: Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#15
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks Aladin!
"Aladin Akyurek" wrote: =2-OR(A1="Apple",A1="Oranges") Storm wrote: Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#16
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I would be tempted to use a vlookup, create a table with your fruit in the
first column and a number in the second. then use formula =vlookup (a1, fruittable, 2,0) "Storm" wrote: Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
#17
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=NOT(OR(A1={"apple","oranges"}))+1
"Storm" wrote: Hi there. How would my if statement look like if I my logical test can be more than 1 value? For example, if cell A1 = "apple" or "oranges", then return 1, else return 2. How can I show the apple or oranges logical test in equation form? Thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Logical test in IF statement returning incorrect result | Excel Worksheet Functions | |||
logical test | Excel Worksheet Functions | |||
logical test | Excel Worksheet Functions | |||
If statement where the logical test is a range that equals a word | Excel Worksheet Functions | |||
Logical test | Excel Discussion (Misc queries) |