I want a function to subtract one number in a cell from another number on a different page and cell based on what word is in the cell next to the original number.
I have a budget page with groceries, miscellaneous, gasoline, eating out, dates, clothes, utilities and phone bill. I have an expence page where I plug in what I spend while I’m out in the world. I have four main columns on the expence page, expence (name of item bought like “frozen pizza” or “QT soda”), cost (dollar amount), date (day I bought it), and type (gasoline, groceries, or miscellaneous). I want a formula in a cell that will read the word in the type cell, subtract the number in the cost cell from the number on the budget page that correlates to the correct type, and print the remaining money left budgeted to that type.
Now that ive typed thus out I actually want the formula to read all the cells and subtract matching types on the expence page from the budget page. The number should update with every type that gets plugged in.
I thought SWITCH would work, but it is not. I’m a begginer with JavaScript, but familiar with how it’s functions work. If I could just write my own code on top of the spread sheet that would be easiest. Maybe something like for(C:C) {if(type) return B2 - “Budget, C3”} else if (anotherType).....
I’m not familiar enough with arrow functions or return functions enough for a JavaScript answer either and would likely be here asking the same question if I were doing it with JS.
Thank you for your time and help.
Aucun commentaire:
Enregistrer un commentaire