Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mark.ew
 
Posts: n/a
Default IF/AND formulas within excel

Hi there,
Could anybody please help me with a formula i am trying to enter into my
excel spreadsheet.
i have two sets of variables "a" and "b" which are related to each other.
Using a seperate formula I obtain "c" What i would like to do is apply 1 of
4 equations to "c" depending on the value of "a" and "b".

if "a"0 and "b"0 then "c" stays as it is
"a"<0 and "b"0 then minus"c" from 360
"a"0 and "b"<0 then minus"c" from 180
"a"<0 and "b"<0 then "c" plus 180

Is it at all possible to formulate the above??

Thanks for any help


Mark
  #3   Report Post  
cwilson
 
Posts: n/a
Default

Hi mark,

See if this works:

A1 B1 C1
# # #

In D1 type
=IF(AND(A10,B10),C1,IF(AND(A1<0,B10),360-C1,IF(AND(A10,B1<0),180-C1,IF(AND(A1<0,B1<0),180+C1,"ERROR"))))

it worked for me.

HTH

cwilson



"mark.ew" wrote:

Hi there,
Could anybody please help me with a formula i am trying to enter into my
excel spreadsheet.
i have two sets of variables "a" and "b" which are related to each other.
Using a seperate formula I obtain "c" What i would like to do is apply 1 of
4 equations to "c" depending on the value of "a" and "b".

if "a"0 and "b"0 then "c" stays as it is
"a"<0 and "b"0 then minus"c" from 360
"a"0 and "b"<0 then minus"c" from 180
"a"<0 and "b"<0 then "c" plus 180

Is it at all possible to formulate the above??

Thanks for any help


Mark

  #4   Report Post  
mark.ew
 
Posts: n/a
Default

"a" "b" "c" are indicative only. I have true numerical values for them. What
i would like to do is enter a formula, that would have excel analyse cells
"va" and "vb" and then depending on the permutations of "va" and "vb" being
positive or negative, apply one of the equations. I have a couple hundred
sets of "va" and "vb" cells, so it would save alot of time, if it was
possible to enter a formula, rather than manually checking each set.
Is it possible to input one formula that contains all four equations below,
but that would only apply the correct one based on positives and negatives of
"va" and "vb"

"Don Guillett" wrote:

I suggest changing your variable names to va, vb,vc and then nesting the
if's

--
Don Guillett
SalesAid Software

"mark.ew" wrote in message
...
Hi there,
Could anybody please help me with a formula i am trying to enter into my
excel spreadsheet.
i have two sets of variables "a" and "b" which are related to each other.
Using a seperate formula I obtain "c" What i would like to do is apply 1

of
4 equations to "c" depending on the value of "a" and "b".

if "a"0 and "b"0 then "c" stays as it is
"a"<0 and "b"0 then minus"c" from 360
"a"0 and "b"<0 then minus"c" from 180
"a"<0 and "b"<0 then "c" plus 180

Is it at all possible to formulate the above??

Thanks for any help


Mark




  #5   Report Post  
JE McGimpsey
 
Posts: n/a
Default

First, what happens if "a"=0 or "b" = 0 ????

One way:

=IF(OR(a=0,b=0),"????",IF(a0,IF(b0,c,180-c),IF(b0,360-c,c+180)))


In article ,
"mark.ew" wrote:

Hi there,
Could anybody please help me with a formula i am trying to enter into my
excel spreadsheet.
i have two sets of variables "a" and "b" which are related to each other.
Using a seperate formula I obtain "c" What i would like to do is apply 1 of
4 equations to "c" depending on the value of "a" and "b".

if "a"0 and "b"0 then "c" stays as it is
"a"<0 and "b"0 then minus"c" from 360
"a"0 and "b"<0 then minus"c" from 180
"a"<0 and "b"<0 then "c" plus 180

Is it at all possible to formulate the above??

Thanks for any help


Mark



  #6   Report Post  
Dana DeLouis
 
Posts: n/a
Default

Just another option:

=CHOOSE(2*(a0)+(b0)+1,c+180,360-c,180-c,c)

However, if a,b, & c are angles, then there may be a more simplified
solution.

--
Dana DeLouis
Win XP & Office 2003


"mark.ew" wrote in message
...
Hi there,
Could anybody please help me with a formula i am trying to enter into my
excel spreadsheet.
i have two sets of variables "a" and "b" which are related to each other.
Using a seperate formula I obtain "c" What i would like to do is apply 1
of
4 equations to "c" depending on the value of "a" and "b".

if "a"0 and "b"0 then "c" stays as it is
"a"<0 and "b"0 then minus"c" from 360
"a"0 and "b"<0 then minus"c" from 180
"a"<0 and "b"<0 then "c" plus 180

Is it at all possible to formulate the above??

Thanks for any help


Mark



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
How do I isolate my Excel server (automation) from other Excel instances? Joseph Geretz Excel Discussion (Misc queries) 5 July 19th 13 03:18 PM
VB Automation is Whacking out my Excel Environment Joseph Geretz Excel Discussion (Misc queries) 2 December 29th 04 03:49 PM
Excel 2000 file when opened in Excel 2003 generates errors? Doug Excel Discussion (Misc queries) 13 December 25th 04 10:20 PM
Macro in Excel 2002 to save a workbook to a FTP location Lloyd Excel Discussion (Misc queries) 0 December 21st 04 02:49 PM
Excel aficionado wants to learn Access Hari Excel Discussion (Misc queries) 0 December 3rd 04 06:03 AM


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