I have a simple Google spreadsheet that Takes the estimated cost for a service provided and compares it to the actual cost of the service. the equation I have in the Q column is =K4-P4. When the estimated cost (column K) is less than the Actual cost (column P) I need a positive number in Column Q. And I need the reverse of that if K is greater than p. I'm new to spreadsheets and would appreciate any help.

enter image description here

  • pls share a copy of your sheet
    – user0
    Commented May 17, 2019 at 0:09
  • I know this sounds very noobish, but I do not see an option to share or upload a copy of my sheet. Can you let me know how I can accomplish that? Commented May 17, 2019 at 0:25
  • in your sheet do: i.sstatic.net/OTFcv.png then paste here the link
    – user0
    Commented May 17, 2019 at 0:44
  • Found it. Here you go. there are only simple add or subtract functions in the sheet. docs.google.com/spreadsheets/d/… Commented May 17, 2019 at 1:01
  • the sheet is private you need to share it with that green button on the top right of your sheet and allow editing with anyone who has a link
    – user0
    Commented May 17, 2019 at 1:08

2 Answers 2


=ARRAYFORMULA(IF(LEN(K4:K&P4:P), IF(K4:K-P4:P<0, P4:P-K4:K, K4:K-P4:P), ))



If you want to always get a positive value you need to use the absolute value function. In the simplest case you just use =abs(value). But that value can be a number, a cell reference or even a formula.

The absolute value function will always return a positive value. In your case just wrap the =K4-P4 with the ABS() function which would be =ABS(K4-P4)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.