# Value Return if less than Zero



## notyours07 (Dec 29, 2022)

Below is an example of an analysis Table. There is a formula under the Currently On Order column (X) that returns a value from Qty Remaining column (I) in worksheet 'PO Items Data'.

The formula is a follows:
=IF(ISBLANK([@Description])," ",IFERROR(VLOOKUP(SUBSTITUTE(B3,"(ALT) ",""),POTable[#Data],9,FALSE), "0"))

The issue I am having is that the returning value is only for the first occurrence of any one matching Part Number, i.e. Part Number 1A in 'PO Items Data' worksheet has 3 occurrences of ZERO, ZERO, and ONE.

I would prefer the formula to return a total value for all Qty Remaining (I) when the Qty Fulfilled (H) is less than the Qty PO (G).
I am unsure how to insert =IF(H2<G2,I2,"0") in the current formula.

Any suggestions are a great help.


----------



## Flashbond (Dec 30, 2022)

I didn't understand the connection between the two calculations. They seem to be different subjects?


----------



## notyours07 (Dec 30, 2022)

Flashbond said:


> I didn't understand the connection between the two calculations. They seem to be different subjects?


I would like to total the Quantity Remaining for each time the Part Number shows up on the 'PO Items Data' worksheet.  And I want that total to show in column (W) on my initial image above.


----------



## Flashbond (Dec 30, 2022)

Are you looking for something like this? HBUC Sparing W2:

```
=IF(H2<G2,SUMIF("PO Items Data"!$A:$A,A2,"PO Items Data"!$I:$I),0)
```


----------



## notyours07 (Dec 30, 2022)

Flashbond said:


> Are you looking for something like this? HBUC Sparing W2:
> 
> ```
> =IF(H2<G2,SUMIF("PO Items Data"!$A:$A,A2,"PO Items Data"!$I:$I),0)
> ```


Sorry no, it doesn't seem to work.
I'd really like to keep as much of the original formal as possible, I'm afraid I may have oversimplified the example image.
The original formula is:
=IF(ISBLANK([@Description])," ",IFERROR(VLOOKUP(SUBSTITUTE(B3,"(ALT) ",""),POTable[#Data],9,FALSE), "0"))

I thought there would be a way to modify the ...POTable[#Data],9,FALSE), "0")) portion with the sum of worksheet 'PO Items Data' column (I) while still referencing a the table.


----------



## Flashbond (Dec 30, 2022)

Ahh, sorry it should be single quotation. I see your point but I can't think of any way to make it work with VLOOKUP.

```
=IF(H2<G2,SUMIF('PO Items Data'!$A:$A,A2,'PO Items Data'!$I:$I),0)
```


----------

