Is there a way to prevent data overwrite error and leave mapping table cell blank?

69 Views Asked by At

sheet Is there a way to code it so I can have blanks in my mapping table without. the formula failing in my budget sheet?

I want it to be able to recognize when the category is Travel, it is Variable and Discretionary. However, I want to leave Travel Blank in the Mapping Table because I don’t want to have to specify each exact transaction that would be categorized as Travel; rather, I’d like it to autofill based on the general Travel Category.

The following formulas have worked, but return ERROR messages because it says it would overwrite data when I type in a specific transaction and then attempt to categorize it as Travel in my Budget sheet.

These all fail when I try to enter data into the Category Column when the Transaction Column is blank in my Mapping Table.

=ARRAYFORMULA(IFERROR(VLOOKUP(BudgetTransaction, {RefTrans, RefCategory}, 2, FALSE), "")

=ARRAYFORMULA(IFERROR(VLOOKUP(BudgetTransaction & BudgetCategory, {RefTrans & RefCategory, RefFreq}, 2, FALSE), ""))

=ARRAYFORMULA(IFERROR(IF(BudgetTransaction<>"", IF(ISNUMBER(MATCH(BudgetTransaction, RefTrans, 0)), VLOOKUP(BudgetTransaction, {RefTrans, RefCategory}, 2, FALSE), ""), ""), ""))

=ARRAYFORMULA(IF((BudgetTransaction<>"")*(NOT(ISBLANK(BudgetTransaction)))*(ISNUMBER(MATCH(BudgetTransaction, RefTrans, 0))), IFERROR(VLOOKUP(BudgetTransaction, {RefTrans, RefCategory}, 2, FALSE), ""), "")) 

you can see the google_sheet

1

There are 1 best solutions below

2
z.. On

You cannot apply INDEX-MATCH to the whole column like this. Use XLOOKUP or VLOOKUP instead:

=ARRAYFORMULA(IF(C2:C="",,VLOOKUP(C2:C,'Mapping Table'!B2:C,2,0)))

enter image description here