Mar 25 2018
02:44 AM
- last edited on
Jul 25 2018
11:27 AM
by
TechCommunityAP
Mar 25 2018
02:44 AM
- last edited on
Jul 25 2018
11:27 AM
by
TechCommunityAP
Hi
Could somebody offer some advice please? Im trying to create what I thought would be a simple formula but after messing about with If and Sumif, I cant make it work.
I'm trying to compare two cell values, if value (a) is greater than value (b) I'd like to subtract value (b) from (a).
Like wise if (b) is greater than (a) I'd like to add them together. Ive tried:
=IF(G7>F7,SUM(F7+G7),SUM(F7-G7)) amongst other formula efforts, but the formulas just add the two values and I cant get the subtraction working.
example: cell (F7)= 114000, and cell (G7)= 128000 - I can get the addition of both ok.
If I make (F7) a higher value than (G7) It wont subtract G7 from F7.
Hope this makes sense?
Any help appreciated
Pete
Mar 25 2018 03:55 AM
Pete,
what's the purpose of this?
=MMULT((F7+G7*{1,-1}),COUNTIFS(G7,{">";"<="}&F7))
Mar 25 2018 02:11 PM - edited Mar 25 2018 02:20 PM
Hello
Thanks for responding, Unfortunately the formula suggested doesn't seem to add the two cells together.
In response to your question, I'm trying to put a a weekly figure into a graph, but its important to see if the current total is higher or lower than the previous week. Its important to add the two cells if this weeks figures are greater than last week, but also to subtract this week from last week if the number has declined from the previous week.
Thanks
Pete
Mar 25 2018 03:12 PM
My formula gives the same results as your formula.
In your formula you can omit the SUM() function.
=IF(G7>F7,F7+G7,F7-G7)
Mar 26 2018 11:40 AM
Mar 26 2018 02:02 PM
Type these formula in two cells and report the results back.
Mar 27 2018 05:07 AM