I am learning Excel and I can sometimes apply what I have learned at work.
Here is my problem:
I wrote a formula with several loops and was told by Excel that the formula is too long. I later read that there cannot be more than six IFs in a formula.
Please let me explain what I would like to accomplish:
The spreadsheet is a simple inventory spreadsheet.The formula in the last sheet will be used in the original inventory file.
There is one sheet for each month, the last sheet being the annual overview.
The last sheet should display the beginning inventory: The item might be added in January or sometime during the year.
The items will not be added by me to the spreadsheet. There might be empty rows and the items might not be ordered. Short: It will look like a mess.
There might be as many as 200 rows.
This is my idea:
I went to the sheet "Inventory"
In cell C2 I set a formula with IF() and LOOKUP() to search for the Products (A and B) in the month of January
I used ISNA() to check for a match.
If there is a match, return the value in column C (the inital stock)
Otherwise, go to the next month (February, March etc).and do the same search
Is there any other way to solve this problem? I read that I could use SUMPRODUCT() but that did not work. If this cannot be done with a formula, would it be possible to write a custom function? I have written basic VBA code before but I have never custom functions.
I really appreciate your help as I can learn and have learned new ways to write my formulas.