Hi,

SIR I HAVE A SHEET IN WHICH I HAVE 6 COLUMNS FOR RICE INVENTORY.

1)Report No
2)IN/OUT/PROCESS/Fg(This column show whether Rice In, out,Proceeds & Finshed goods)
3)Product Name
4) In (If In & FG i have make entry of quantity in this column)
5) Out (If out or process i have make entry of quanitity in this column)
6) Balance

Now i want that balance column check the report number, product name , & whether it is IN OUT Or other so it give me balance

If it is IN or FG so it add or if it out or Process its less it.

You will need to use "if" statements as well as "SUMIF". For example, you column headers in row#1 will be A-F as stated above. Make 4 examples of the things you need (make sure your numerical values are either positive or negative...out should be negative):

  1. (report#) 1 / (status) IN / (product name) Basmati / (in): 1000 / (out) [blank due to "in" status] / (balance) [use the following code:

    =IF(B2="IN",D2,(IF(B2="FINISHED GOODS",D2,E2)))

(this will look at cell B2 for "in", and if it says that it will bring over D2's value into F2. Else, it will look for "FINISHED GOODS" in D2, if it's there it will bring D2's value over to F2. If not, then it will bring over E2's value into F2)

In order to sum it all up, you can do a total sum by using:

=SUM(F2:F5)

(this will add up all values in the range for a total)

***you can use the following code to add just the values for those products with a status of "in" or "FINSIHED GOODS" by using the following code:

=SUMIF(F2:F5,">=0",F2:F5)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.