Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default How to check for 1 of 4 conditions...Help Please

I have created a drop list that has four possible selections (Validation)
being A B C or D in the column next to it I want to do a check and a
calculation but I'm having problems with too many "If" scenarios <. How can
I get this to check the first column for either A, B ,C or D without my
"IF's" conflicting...

Ex:

If cell A2 = A, then A-100 (goes in cell B2)
If cell A2 = B, then B+100 (goes in cell B2)
If cell A2 = C, then C/100 (goes in cell B2)
If cell A2 = D, then D*100 (goes in cell B2)

Thank you

--
jgbadingerjr
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to check for 1 of 4 conditions...Help Please

=if(a2="","",if(a2=a,a-100,if(a2=b,b+100,if(a2=c,c/100,d*100))))

I think????

jgbadingerjr wrote:

I have created a drop list that has four possible selections (Validation)
being A B C or D in the column next to it I want to do a check and a
calculation but I'm having problems with too many "If" scenarios <. How can
I get this to check the first column for either A, B ,C or D without my
"IF's" conflicting...

Ex:

If cell A2 = A, then A-100 (goes in cell B2)
If cell A2 = B, then B+100 (goes in cell B2)
If cell A2 = C, then C/100 (goes in cell B2)
If cell A2 = D, then D*100 (goes in cell B2)

Thank you

--
jgbadingerjr


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default How to check for 1 of 4 conditions...Help Please

What does this condition mean: If cell A2 = A, then A-100 (goes in cell B2)

A - 100 will give you an error if you try to do that calculation in Excel.
Do you mean A1-100? A2-100? A3-100?

Assuming A2 is what you meant, then
=IF(A2="A",A2-100,IF(A2="B",B2-100,IF(A2="C",C2-100,IF(A2="D",D2*100,""))))

Of course these cell references may be different than what you intend
because your conditions don't give cell references.

Dave

--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"jgbadingerjr" wrote:

I have created a drop list that has four possible selections (Validation)
being A B C or D in the column next to it I want to do a check and a
calculation but I'm having problems with too many "If" scenarios <. How can
I get this to check the first column for either A, B ,C or D without my
"IF's" conflicting...

Ex:

If cell A2 = A, then A-100 (goes in cell B2)
If cell A2 = B, then B+100 (goes in cell B2)
If cell A2 = C, then C/100 (goes in cell B2)
If cell A2 = D, then D*100 (goes in cell B2)

Thank you

--
jgbadingerjr

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default How to check for 1 of 4 conditions...Help Please...Apology<

I apologize, I was trying to keep it basic (generic). Here is what I am
trying to get these series of "IF's" to do...

In cell A2 thru A5 I created a Validation List (NE,SE,SW,NW) these represent
4 possible directions from the Cardinal directions of North, East, South and
West as they are known to be "Quadrants" (Northeast, Southeast, Southwest and
Northwest). The list will keep someone from entering "bad data", what I want
to do next in B2 thru B5 is enter a bearing direction (I have a macro to
convert decimal/degrees but its not necessary at this time) so the format at
this time will be just a whole number (I can change it later because I may
opt not to use the macro). In C2 thru C5 this is where the "function" of IF's
will occur.

Here is what I would like to happen...someone will start in A2 and select a
Quadrant (NE,SE,SW,NW) then in B2 they will enter a number. In C2 the "IF"
scenario will process the previous entered data and one of four things will
happen...If NE then C2 will reflect that number as it is (B2 is B2 nothing
occurs-I guess it could be multiplied by 1 or plus zero) If SE then C2 will
reflect the result of 180-B2, If SW the C2 will reflect the result of 180+B2,
If NW then C2 wil reflect the result of 360-B2. I was also trying to see how
to I think the term is "nest" IF's ...that was the reason for such a generic
explanation, I see now my letters would confuse the cells being called <.
Thanks for your efforts!
--
jgbadingerjr


"jgbadingerjr" wrote:

I have created a drop list that has four possible selections (Validation)
being A B C or D in the column next to it I want to do a check and a
calculation but I'm having problems with too many "If" scenarios <. How can
I get this to check the first column for either A, B ,C or D without my
"IF's" conflicting...

Ex:

If cell A2 = A, then A-100 (goes in cell B2)
If cell A2 = B, then B+100 (goes in cell B2)
If cell A2 = C, then C/100 (goes in cell B2)
If cell A2 = D, then D*100 (goes in cell B2)

Thank you

--
jgbadingerjr

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to check for 1 of 4 conditions...Help Please...Apology<

How about:
=IF(A2="","",IF(A2="NE",B2,IF(A2="SE",180-B2,IF(A2="SW",180+B2,360-B2))))

Notice that I didn't check for the last option (NW and 360-B2). Since you have
data|validation in A2, I know that the cell is empty or one of the other 4.

And if it isn't empty and it's not one of the first three, it has to be the last
option (SW).


jgbadingerjr wrote:

I apologize, I was trying to keep it basic (generic). Here is what I am
trying to get these series of "IF's" to do...

In cell A2 thru A5 I created a Validation List (NE,SE,SW,NW) these represent
4 possible directions from the Cardinal directions of North, East, South and
West as they are known to be "Quadrants" (Northeast, Southeast, Southwest and
Northwest). The list will keep someone from entering "bad data", what I want
to do next in B2 thru B5 is enter a bearing direction (I have a macro to
convert decimal/degrees but its not necessary at this time) so the format at
this time will be just a whole number (I can change it later because I may
opt not to use the macro). In C2 thru C5 this is where the "function" of IF's
will occur.

Here is what I would like to happen...someone will start in A2 and select a
Quadrant (NE,SE,SW,NW) then in B2 they will enter a number. In C2 the "IF"
scenario will process the previous entered data and one of four things will
happen...If NE then C2 will reflect that number as it is (B2 is B2 nothing
occurs-I guess it could be multiplied by 1 or plus zero) If SE then C2 will
reflect the result of 180-B2, If SW the C2 will reflect the result of 180+B2,
If NW then C2 wil reflect the result of 360-B2. I was also trying to see how
to I think the term is "nest" IF's ...that was the reason for such a generic
explanation, I see now my letters would confuse the cells being called <.
Thanks for your efforts!
--
jgbadingerjr

"jgbadingerjr" wrote:

I have created a drop list that has four possible selections (Validation)
being A B C or D in the column next to it I want to do a check and a
calculation but I'm having problems with too many "If" scenarios <. How can
I get this to check the first column for either A, B ,C or D without my
"IF's" conflicting...

Ex:

If cell A2 = A, then A-100 (goes in cell B2)
If cell A2 = B, then B+100 (goes in cell B2)
If cell A2 = C, then C/100 (goes in cell B2)
If cell A2 = D, then D*100 (goes in cell B2)

Thank you

--
jgbadingerjr


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default How to check for 1 of 4 conditions...Help Please...Apology<

Got it! Didn't know you could leave out a list item if the others arent met
then it has to be the only one left^^ Thanks! Big Help!
--
jgbadingerjr


"Dave Peterson" wrote:

How about:
=IF(A2="","",IF(A2="NE",B2,IF(A2="SE",180-B2,IF(A2="SW",180+B2,360-B2))))

Notice that I didn't check for the last option (NW and 360-B2). Since you have
data|validation in A2, I know that the cell is empty or one of the other 4.

And if it isn't empty and it's not one of the first three, it has to be the last
option (SW).


jgbadingerjr wrote:

I apologize, I was trying to keep it basic (generic). Here is what I am
trying to get these series of "IF's" to do...

In cell A2 thru A5 I created a Validation List (NE,SE,SW,NW) these represent
4 possible directions from the Cardinal directions of North, East, South and
West as they are known to be "Quadrants" (Northeast, Southeast, Southwest and
Northwest). The list will keep someone from entering "bad data", what I want
to do next in B2 thru B5 is enter a bearing direction (I have a macro to
convert decimal/degrees but its not necessary at this time) so the format at
this time will be just a whole number (I can change it later because I may
opt not to use the macro). In C2 thru C5 this is where the "function" of IF's
will occur.

Here is what I would like to happen...someone will start in A2 and select a
Quadrant (NE,SE,SW,NW) then in B2 they will enter a number. In C2 the "IF"
scenario will process the previous entered data and one of four things will
happen...If NE then C2 will reflect that number as it is (B2 is B2 nothing
occurs-I guess it could be multiplied by 1 or plus zero) If SE then C2 will
reflect the result of 180-B2, If SW the C2 will reflect the result of 180+B2,
If NW then C2 wil reflect the result of 360-B2. I was also trying to see how
to I think the term is "nest" IF's ...that was the reason for such a generic
explanation, I see now my letters would confuse the cells being called <.
Thanks for your efforts!
--
jgbadingerjr

"jgbadingerjr" wrote:

I have created a drop list that has four possible selections (Validation)
being A B C or D in the column next to it I want to do a check and a
calculation but I'm having problems with too many "If" scenarios <. How can
I get this to check the first column for either A, B ,C or D without my
"IF's" conflicting...

Ex:

If cell A2 = A, then A-100 (goes in cell B2)
If cell A2 = B, then B+100 (goes in cell B2)
If cell A2 = C, then C/100 (goes in cell B2)
If cell A2 = D, then D*100 (goes in cell B2)

Thank you

--
jgbadingerjr


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to check for 1 of 4 conditions...Help Please...Apology<

It all depends on that Data|Validation. Without that, you'd want to do
something else:

=IF(A2="","",IF(A2="NE",B2,IF(A2="SE",180-B2,
IF(A2="SW",180+B2,if(a2="NW",360-B2,"Invalid")))))



jgbadingerjr wrote:

Got it! Didn't know you could leave out a list item if the others arent met
then it has to be the only one left^^ Thanks! Big Help!
--
jgbadingerjr

"Dave Peterson" wrote:

How about:
=IF(A2="","",IF(A2="NE",B2,IF(A2="SE",180-B2,IF(A2="SW",180+B2,360-B2))))

Notice that I didn't check for the last option (NW and 360-B2). Since you have
data|validation in A2, I know that the cell is empty or one of the other 4.

And if it isn't empty and it's not one of the first three, it has to be the last
option (SW).


jgbadingerjr wrote:

I apologize, I was trying to keep it basic (generic). Here is what I am
trying to get these series of "IF's" to do...

In cell A2 thru A5 I created a Validation List (NE,SE,SW,NW) these represent
4 possible directions from the Cardinal directions of North, East, South and
West as they are known to be "Quadrants" (Northeast, Southeast, Southwest and
Northwest). The list will keep someone from entering "bad data", what I want
to do next in B2 thru B5 is enter a bearing direction (I have a macro to
convert decimal/degrees but its not necessary at this time) so the format at
this time will be just a whole number (I can change it later because I may
opt not to use the macro). In C2 thru C5 this is where the "function" of IF's
will occur.

Here is what I would like to happen...someone will start in A2 and select a
Quadrant (NE,SE,SW,NW) then in B2 they will enter a number. In C2 the "IF"
scenario will process the previous entered data and one of four things will
happen...If NE then C2 will reflect that number as it is (B2 is B2 nothing
occurs-I guess it could be multiplied by 1 or plus zero) If SE then C2 will
reflect the result of 180-B2, If SW the C2 will reflect the result of 180+B2,
If NW then C2 wil reflect the result of 360-B2. I was also trying to see how
to I think the term is "nest" IF's ...that was the reason for such a generic
explanation, I see now my letters would confuse the cells being called <.
Thanks for your efforts!
--
jgbadingerjr

"jgbadingerjr" wrote:

I have created a drop list that has four possible selections (Validation)
being A B C or D in the column next to it I want to do a check and a
calculation but I'm having problems with too many "If" scenarios <. How can
I get this to check the first column for either A, B ,C or D without my
"IF's" conflicting...

Ex:

If cell A2 = A, then A-100 (goes in cell B2)
If cell A2 = B, then B+100 (goes in cell B2)
If cell A2 = C, then C/100 (goes in cell B2)
If cell A2 = D, then D*100 (goes in cell B2)

Thank you

--
jgbadingerjr


--

Dave Peterson


--

Dave Peterson
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
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
How do I check/uncheck ten or odd Checkboxes by click on one check Ken Vo Excel Discussion (Misc queries) 5 January 4th 06 11:10 PM
Function to check list for specific conditions and return an answe tanya Excel Discussion (Misc queries) 2 July 6th 05 11:43 AM
How to multiple conditions to validate more than 2 conditions to . Bhuvana Govind Excel Worksheet Functions 1 January 28th 05 07:07 PM
How do I check the conditions of 2 fields to return a result Jimbob Excel Discussion (Misc queries) 3 January 17th 05 11:59 AM


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