Forum Discussion
rrbailey
Jun 03, 2022Copper Contributor
Subtract like values that share similar data
I have 4 sets of data that I am attempting to compare and subtract the numbers in the columns to the right of said data. Column A and Column D are the similar static data. Colmn B and E are the varia...
- Jun 04, 2022so you only want the values in columns D/E to have the difference shown? Try this:
=IFERROR(VLOOKUP(D3,A$3:B$100,2,0),0)-E3
So if it doesn't find the name in col D in col A then it will return 0 - D3 or basically negative of the value in E3
rrbailey
Jun 04, 2022Copper Contributor
mtarler Appreciate your assistance on this, however it still seems as if the formula is doing some weird stuff, for example the result of B5 - E4 is in F5 when it should be in F4.
mtarler
Jun 04, 2022Silver Contributor
so you only want the values in columns D/E to have the difference shown? Try this:
=IFERROR(VLOOKUP(D3,A$3:B$100,2,0),0)-E3
So if it doesn't find the name in col D in col A then it will return 0 - D3 or basically negative of the value in E3
=IFERROR(VLOOKUP(D3,A$3:B$100,2,0),0)-E3
So if it doesn't find the name in col D in col A then it will return 0 - D3 or basically negative of the value in E3
- mtarlerJun 04, 2022Silver Contributor=IFERROR(VLOOKUP(D3,A$3:B$100,2,0)-E3,"N/A")
or replace that "N/A" with 0 or blank ("") - rrbaileyJun 04, 2022Copper ContributorThank you this works perfectly! How could it be adapted to instead of reflecting a negative value of whats in column E and instead show N/A or 0?