I am trying to find a specific conditional formatting formula. I want specific cells within a column to automatically fill with a specific text based on what cell value I type into an adjacent cell. What formula would be best to use?
The attached image should help to explain. I want the column (LITH) to populate with any of the text choices in the column (LITHTYPES), based on the criteria of typing in (CODE) numbers -1 to 5 in column (LITH_CODE)
I agree with @cybernetic.nomad. I think you are looking for a vlookup
or a combination index
+ match
. Conditional formatting is used for changing colour of cell/text based on criterias. The formula you are looking for (enter it in Cell F2
and drag down) is (notice I use " ;
" as delimiter instead of " ,
":
=IF(E2="";"";INDEX($N$4:$N$10;MATCH(E2;$M$4:$M$10;0)))
The formula is explained by the following parts: IF(if a cell in column LITH_CODE is empty; if it's empty then show nothing; do lookup )
The do lookup part contains of: INDEX(return value from LITHTYPES ; MATCH(lookup value from LITH_CODE column ; look for the value from LITH_CODE in the column "M" CODES; give only exact match))
I think the picture below gives a good view:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.