Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
JeremyH1982
 
Posts: n/a
Default The "IF" Statement

i am trying to get a formula to change negative numbers into positive numbers
if they are negative and only on certain documents; these documents have a #
2 or 3 indicating the document types in Column D; The figures that i want to
change into negative if positive and positive if currently negative are in
column G; H; I; & J; The formula that i had typed out is wrong and it goes a
little something like this:
=IF($D7=2, ($G7=$G7*-1; $H7=$H7*-1; $I7=$I7*-1;
$J7=$J7*-1),IF($D7=3,($G7=$G7*-1; $H7=$H7*-1; $I7=$I7*-1; $J7=$J7*-1),
$D7="Null"))

if someone could please point out to me the problem with this? and maybe
suggest a formula to fix this? Please?
  #2   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default The "IF" Statement

On Tue, 18 Oct 2005 11:45:03 -0700, "JeremyH1982"
wrote:

i am trying to get a formula to change negative numbers into positive numbers
if they are negative and only on certain documents; these documents have a #
2 or 3 indicating the document types in Column D; The figures that i want to
change into negative if positive and positive if currently negative are in
column G; H; I; & J; The formula that i had typed out is wrong and it goes a
little something like this:
=IF($D7=2, ($G7=$G7*-1; $H7=$H7*-1; $I7=$I7*-1;
$J7=$J7*-1),IF($D7=3,($G7=$G7*-1; $H7=$H7*-1; $I7=$I7*-1; $J7=$J7*-1),
$D7="Null"))

if someone could please point out to me the problem with this? and maybe
suggest a formula to fix this? Please?


A function can only return a value; it cannot change something in some other
cell.

You could have functions in some kind of mirror column or you could use a VBA
macro to accomplish your task; and then run it or have it run depending on a
worksheet or workbook change event.

For the functions you could make your entries in G7:J7 as you have; but then
for display or future computations have your numbers showing in, let us say
AG7:AJ7.

You would then put the formula:

AG7: =IF(OR($D7={2,3}),ABS(G7),G7)

and copy/drag that across to AJ7

For writing a VBA macro, it would be important to know whether the values in
columns G:J are put there by direct entry, or as the result of a formula.




--ron
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
Long IF Statement rmitchell87 Excel Discussion (Misc queries) 2 October 2nd 05 03:50 AM
If statement Matt Montagliano Excel Discussion (Misc queries) 1 September 8th 05 08:47 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
IF Statement nightmare eugenevr Excel Discussion (Misc queries) 6 May 18th 05 01:09 PM
How to calculate a sum as one outcome of an IF statement barb in NC Excel Worksheet Functions 2 March 31st 05 08:01 PM


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