Help with assigning account codes to one table from another table

Copper Contributor

I'm trying to find and assign account codes for monthly accounting books I have for my business. What I'd like excel to do is search for text in a column ("Name" column shown below) and, if specific text is found in a cell ("Text field" column shown below), return the account code from the table on the right with the specific text. Please see image below. Is there a function I can use to automate the process of assigning account codes to various expenses?

 

Screen Shot 2019-10-01 at 11.27.58 AM.png

7 Replies

@Gsurfer210 

That could be like

=IFERROR(INDEX(<Account Code range>,MATCH(1,--ISNUMBER(SEARCH(<Text range>,<Name>)),0)),"")

where the ranges are related columns and the <Name> is the cell value for which your search the code.

Thanks, @Sergei Baklan, for your help. I'm new to excel and unfamiliar with what <account code range> and <text range> would be in this case. If account code is in column H, would <account code range> be H5:H8 for example? I've included a second picture showing rows and columns below. Screen Shot 2019-10-02 at 7.54.40 PM.png

@Gsurfer210 

Yes, I meant under <Account code range> $H$5:$H$100, <Name range> - $C$5:$C$100, etc.

 

It's always better to attach small sample file with/instead of screenshort. Very few people will type data manually from screen picture into the file to illustrate how formula works on real data.

@Sergei Baklan , thanks, Sergei, for you continued help. When I input the formula in the 'Account Code' column, it returns a blank. What I'm trying to do is have the formula return, for example, '6300' in cell D5, '6900' in cell D6, etc. Could you show me how to do this? Please see attached the sample file. 

@Gsurfer210 

Sorry, I forgot to mention you shall use it as an array formula, i.e. enter with combination of Ctrl+Shift+Enter instead of Enter. Result is

image.png

and in attached file