Forum Discussion

Sebastian Lyngra's avatar
Sebastian Lyngra
Copper Contributor
Jul 30, 2018

Sold items in storage

I want to know how many Sold items that are still inn storage.
Colum B shows how many items of each model is in storage.

Colum C shows how many items of each model is sold.

Somthimes we have 1 in storage but sell 2, the count should then say that there is 1 sold in storage.

What kind of formula or macro must i use to get this right? Please help me, this has been bugging me for a year.

2 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    Hi Sebastian

     

    That could be array formula

    =SUM(IF($B$2:$B$7<=$C$2:$C$7,$B$2:$B$7,$C$2:$C$7))

    or regular one

    =SUMPRODUCT(($B$2:$B$7<=$C$2:$C$7)*$B$2:$B$7+$C$2:$C$7*($B$2:$B$7>$C$2:$C$7))

    Attached

Resources