I have a spreadsheet that I am trying to use to keep track of inbound and outbound shipments, plus have it compute a running inventory total after each transaction. I am also trying to keep the sheet 'clean' by having it not post anything to the totals cells if there are not inbound or outbound shipments entered.
The inventory portion of the sheet is here:
If there are any bags in (D7) and I have entered the bag weight (E7), then D7 and E7 are multiplied together and the total bagged weight entered into F7, else leave the cell blank (formula =IF(AND(D7<>"",E7<>""),D7*
E7,""). This gets me the total inbound bagged weight, F7. G7 is bulk inbound shipments, and H7 is bulk outbound shipments.
To calculate the total inventory while keeping the sheet 'clean', I want Excel to look first and see if there is any data in the total bagged weight in (F7), inbound bulk shipments (G7), or outbound bulk shipments (H7), take the previous total inventory (I6) and add to it the inbound bagged weight (F7) and inbound bulk weight (G7) and subtract any outbound shipments (H7), and place the new total in I7. If there is no data in any of F7, G7, H7, leave I7 blank. My formula looks like this: =IF(OR(F7<>"",G7<>"",H7<>"
This formula works fine, as long as you have something in F7. However, if you try to just place a bulk shipment in our out (G7, H7), the formula fails with 'A value used in the formula is of the wrong data type'.
If I delete the formula that calculates F7, the total inventory formula in I7 works fine. I suspect this means that the OR statement in I7 reads the formula in F7 as some type of data, rather than seeing a blank cell.
Does anyone know how I can correct or work around this? It seems like it should be simple (I expect it is), but I can't seem to find the solution.