Forum Discussion
Robert_Peltzman
Nov 30, 2021Copper Contributor
Juggling items from one column to it's corresponding row in a new column
I've got an inventory list in column A of all my meds (about 300). I've got a medication usage list in a different column (say, C) that only has the list of meds that I've dispensed in the last month...
bosinander
Nov 30, 2021Iron Contributor
Robert_Peltzman Hi,
With Excel 365 you can have cell B1
=XLOOKUP(A1;C:C;D:D;"")
being similar to in older versions of Excel, use
=IFERROR(VLOOKUP(A1;C:D;2;0);0)
and in both cases fill down or.
Even better, select in column A an Insert:table. Your formulas will then expand with the number of rows in the table.
Both columns Usage and Out are calculated.
Beware though that if you undo a change in a tables column formula, you may have to undo two or three times to come back to previous state.
- Robert_PeltzmanNov 30, 2021Copper ContributorThanks Bos. This gives some options to play with.
- Robert_PeltzmanNov 30, 2021Copper ContributorBefore I try some of those formulas, tomorrow, I've got one more question: The meds in column C all have numbers associated with then in col. D (not shown). After I move col. C, over, how do I reattach those numbers to the items in the new Col. B?
- bosinanderNov 30, 2021Iron Contributor
Mm... if you have the article numbers, use them instead of the names and you will get better results since it may happen that two different numbers share the same name.
Adjust the formulas to use the numbers;
D2 =IFERROR(VLOOKUP(A2;G:I;3;0);0)