If statement issue

Monjavz

New Member
Joined
May 8, 2019
Messages
12
I need help please, I have various conditions and got this far

=IF(AND(W687>0;X686>0);(W687*Y687*G687)+X686*Y687*G687;0)

only problem is that if cell W687 is negative it should still perform the calculation for X686 if this cell is positive.

How can I change the formula to do this.

Thank you very much
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Do you mean like this?

=IF(OR(W687<0,AND(W687>0;X686>0));(W687*Y687*G687)+X686*Y687*G687;0)
 
Upvote 0
Or just use ABS on the cell in question which turns a negative number positive.
 
Upvote 0
Thanks I changed it to OR, but now it is still not calculating correctly.

What in short happens is that I have a running balance that changes with movements + or - and there are certain days that needs to be calculated on the opening and closing balance. And when the running balance is negative no calc should take place only the opening balance portion should calculate

Rate MVT Quantity Running total Days Costs
2000 (opening balance)
0.80 -100 1900 7 11 120.00

So for 6 days the balance was 2000 and then for one day it is 1900 at a rate of 0.80

Then what makes it even further complicated is that the running total runs into a negative and then you will only have to calculate cost for the #days for the opening balance if the closing balance after it goes negative does not incur any costs. Hope this makes sense. I'm so confused as I have tried many means still not getting the answer right and the sheet has numerous lines I need a formula that works that I can pull down

Thanks
 
Upvote 0
Im afraid that its hard to understand what you mean. How about providing some sample data with expected results of the formula?
 
Upvote 0
MovementDateDateDaysRate checkBTW Rate MovementQty Running Total Days Berging Correct answer
2018/02/282018/04/01 2 065,72 2 065,72
2018/03/072018/02/28 7 0,80 1,14 - 100,00 1 965,72 7 11 008,03 11 488,03
2018/03/132018/03/07 6 0,80 1,14 - 35,00 1 930,72 6 9 267,46 9 407,46
2018/03/132018/03/13 - 0,80 1,14 - 100,00 1 830,72 - - -
2018/03/192018/03/13 6 0,80 1,14 - 200,00 1 630,72 6 7 827,46 8 627,46
2018/03/232018/03/19 4 0,80 1,14 - 100,00 1 530,72 4 4 898,30 5 138,30
2018/03/232018/03/23 - 0,80 1,14 - 35,00 1 495,72 - - -
2018/03/262018/03/23 3 0,80 1,14 - 90,72 1 405,00 3 3 372,00 3 517,15
2018/03/282018/03/26 2 0,80 1,14 0,41 1 405,41 2 2 248,66 2 248,33
2018/03/302018/03/28 2 0,80 1,14 - 100,00 1 305,41 2 2 088,66 2 168,66
2018/04/092018/03/30 10 0,80 1,15 - 2,80 1 302,62 10 10 420,92 10 441,04
2018/04/112018/04/09 2 0,80 1,15 - 33,42 1 269,20 2 2 030,71 2 057,45
2018/04/112018/04/11 - 0,80 1,15 - 33,36 1 235,84 - - -
2018/04/112018/04/11 - 0,80 1,15 - 34,08 1 201,76 - - -
2018/04/112018/04/11 - 0,80 1,15 - 34,26 1 167,50 - - -
2018/04/112018/04/11 - 0,80 1,15 - 33,14 1 134,36 - - -
2018/04/112018/04/11 - 0,80 1,15 - 34,44 1 099,92 - - -
2018/04/112018/04/11 - 0,80 1,15 - 33,86 1 066,06 - - -
2018/04/122018/04/11 1 0,80 1,15 12,58 1 078,64 1 862,91 862,91
2018/04/122018/04/12 - 0,80 1,15 100,00 1 178,64 - - 80,00
2018/04/122018/04/12 - 0,80 1,15 300,00 1 478,64 - - 240,00
2018/04/162018/04/12 4 0,80 1,15 17,42 1 496,06 4 4 787,38 4 745,58
2018/04/182018/04/16 2 0,80 1,15 0,20 1 496,26 2 2 394,01 2 393,85
2018/04/182018/04/18 - 0,80 1,15 - 0,06 1 496,20 - - -
2018/04/192018/04/18 1 0,80 1,15 - 1 000,00 496,20 1 396,96 396,96
2018/04/202018/04/19 1 0,80 1,15 - 200,00 296,20 1 236,96 236,96
2018/04/262018/04/20 6 0,80 1,15 0,19 296,38 6 1 422,64 1 421,90
2018/05/012018/04/26 5 0,85 1,15 - 0,66 295,73 5 1 256,84 1 259,07
2018/05/032018/05/01 2 0,85 1,15 20,00 315,73 2 536,73 519,73
2018/05/092018/05/03 6 0,85 1,15 - 215,59 100,13 6 510,67 1 426,95
2018/05/232018/05/09 14 0,85 1,15 - 30,00 70,13 14 834,57 1 166,07
2018/05/252018/05/23 2 0,85 1,15 0,78 70,91 2 120,55 119,88
2018/05/312018/05/25 6 0,85 1,15 - 33,98 36,93 6 188,34 332,75
2018/06/042018/05/31 4 0,85 1,15 - 6,04 30,89 4 105,03 120,43
2018/06/062018/06/04 2 0,85 1,15 - 33,00 - 2,11 2 52,52 26,25

<colgroup><col><col><col><col span="2"><col><col><col><col span="2"></colgroup><tbody>
</tbody>
 
Upvote 0
For the first line and using the provided data how is that calculated?
 
Upvote 0

Forum statistics

Threads
1,215,212
Messages
6,123,649
Members
449,111
Latest member
ghennedy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top