Excel Formula - Add cell + “.jpg” based on value in B1 and C1 is blank

感情迁移 提交于 2020-01-15 12:58:07

问题


I hope someone can assist with this issue I can't solve.

I have an excel sheet that I want to automatically add a specific value based on a cell's SkU number and add a .jpg extension to that SKU in another cell automatically

Basically if there is a value in cell B2 and C2 is blank I want to automatically add in column I the value from B2 + .jpg Then also add in column M (a static value) Color::1|Size::2

Right now I have a simple formula in Column I =B2&".jpg"

    B                  C                  I                 M
product_sku     product_parent_sku  product_full_image  attributes
ABC-0001                            ABC-0001.jpg        Color::1|Size::2
ABC-0001        ABC-0001-1      
ABC-0001        ABC-0001-2      
ABC-0002                            ABC-0002.jpg        Color::1|Size::2

回答1:


Suggest either nested IF statements or an IF statement with an AND condition in I2:-

=IF(B2="","",IF(C2="",B2&".jpg",""))

or

=IF(AND(B2<>"",C2=""),B2&".jpg","")

Then M2 is only filled in if I2 is filled in:-

=IF(I2="","","Color::1|Size::2")

Pull the formulae down as required.




回答2:


=IF(AND(ISBLANK(B2)=FALSE,ISBLANK(C2)),B2 & ".jpg","") =IF(AND(ISBLANK(B2)=FALSE,ISBLANK(C2)),"Color::1|Size::2","")



来源:https://stackoverflow.com/questions/28011812/excel-formula-add-cell-jpg-based-on-value-in-b1-and-c1-is-blank

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!