Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default IF/OR/AND function in a formula

I have a unique scenario and need assiatance to create a formula.

I have dollar amounts in A,B,C,D,E,F columns. I need a result in G

it should be A+B+C. If A+B+C equals 0 the result should be D. If D also
equals 0 then the result should be E - F. Please help. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
Default IF/OR/AND function in a formula

"Rumy" wrote:
I have dollar amounts in A,B,C,D,E,F columns. I need a result in G[.]
it should be A+B+C. If A+B+C equals 0 the result should be D. If D
also equals 0 then the result should be E - F. Please help.


=if(A1+B1+C1<0, A1+B1+C1, if(D1=0, E1-F1, D1))

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
Default IF/OR/AND function in a formula

PS....

"Rumy" wrote:
I have dollar amounts in A,B,C,D,E,F columns.


If you mean that you have dollar-and-cents amounts with mixed signs (some
positive, some negative), or if the "dollar" amounts are the result of
formulas formatted with zero decimal places, note that what appears to be
zero is not always exactly zero.

So it would be prudent to write:

=round(if(round(A1+B1+C1,2)<0, A1+B1+C1, if(D1=0, E1-F1, D1)), 2)

Change D1=0 to ROUND(D1,2)=0 if you did not round the formula in D1.


----- original message -----

"Joe User" <joeu2004 wrote in message
...
"Rumy" wrote:
I have dollar amounts in A,B,C,D,E,F columns. I need a result in G[.]
it should be A+B+C. If A+B+C equals 0 the result should be D. If D
also equals 0 then the result should be E - F. Please help.


=if(A1+B1+C1<0, A1+B1+C1, if(D1=0, E1-F1, D1))


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default IF/OR/AND function in a formula

=IF(SUM(A2:C2)=0,IF(D2=0,SUM(E2:F2),D2),SUM(A2:C2) )
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Rumy" wrote:

I have a unique scenario and need assiatance to create a formula.

I have dollar amounts in A,B,C,D,E,F columns. I need a result in G

it should be A+B+C. If A+B+C equals 0 the result should be D. If D also
equals 0 then the result should be E - F. Please help. Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default IF/OR/AND function in a formula

Hi Rumy
This is what I got:
=IF(AND(SUM(A2:C2)=0,D2=0),E2-F2,IF(SUM(A2:C2)=0,D2,SUM(A2:C2)))

If I am reading the problem correctly,
Luke's formula is shorter and, therefore, more elegant, but it adds E and F,
rather than subtracting F from E.
With the following revision, I like Luke's better:
=IF(SUM(A2:C2)=0,IF(D2=0,E2-F2,D2),SUM(A2:C2))
The both test out the same.
M

"Rumy" wrote:

I have a unique scenario and need assiatance to create a formula.

I have dollar amounts in A,B,C,D,E,F columns. I need a result in G

it should be A+B+C. If A+B+C equals 0 the result should be D. If D also
equals 0 then the result should be E - F. Please help. Thanks.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default IF/OR/AND function in a formula

Thank you both Luke and Minty Fresh :) That was a great help.

"Minty Fresh" wrote:

Hi Rumy
This is what I got:
=IF(AND(SUM(A2:C2)=0,D2=0),E2-F2,IF(SUM(A2:C2)=0,D2,SUM(A2:C2)))

If I am reading the problem correctly,
Luke's formula is shorter and, therefore, more elegant, but it adds E and F,
rather than subtracting F from E.
With the following revision, I like Luke's better:
=IF(SUM(A2:C2)=0,IF(D2=0,E2-F2,D2),SUM(A2:C2))
The both test out the same.
M

"Rumy" wrote:

I have a unique scenario and need assiatance to create a formula.

I have dollar amounts in A,B,C,D,E,F columns. I need a result in G

it should be A+B+C. If A+B+C equals 0 the result should be D. If D also
equals 0 then the result should be E - F. Please help. Thanks.

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
IF Function formula (I think?) Rocktaxi Excel Worksheet Functions 4 October 26th 09 03:48 PM
Help with OR function in IF function formula veggies27 Excel Worksheet Functions 3 March 18th 08 10:04 PM
formula using IF function bronxbabe Excel Worksheet Functions 3 February 13th 08 04:15 PM
A formula/function to return a formula/function sith janitor Excel Worksheet Functions 4 September 22nd 06 05:01 PM
function/formula help suki2shoes Excel Worksheet Functions 4 August 25th 05 01:03 PM


All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"