I have excel sheet with 2 columns: baseline, current.
the baseline if base prices and the current is real price.
for example:
base | curr
-----|-----
10 | 15
8 | 8
9 | 5
1 | 2
-----|-----
27 | 28
Now, I need the difference if HIGHER current prices.. in our example, the first and last line have bigger current price, so i need the formula to return 6 (=15-10+2-1).
is there any way to do it in excel formula? I need to loop on all the rows and mark the curr>base rows, and then do the sum(curr-base) for everyone of the results.
I tried it with sumproduct, and other functions (sumifs and such) with no help...
any idea how to solve this?
Thanks!
Navigate to the "Home" option and select duplicate values in the toolbar. Next, navigate to Conditional Formatting in Excel Option. A new window will appear on the screen with options to select "Duplicate" and "Unique" values. You can compare the two columns with matching values or unique values.
If you don't like those --
you can also get the formula this way:
=SUMPRODUCT((B1:B3>A1:A3)*(B1:B3-A1:A3))
Note: the *
replaced the ,
Found the answer.. no need for new column or so..
=SUMPRODUCT(--(B1:B3>A1:A3),--(B1:B3-A1:A3))
column base = A, curr = B
Thanks for trying..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With