How to write formula for cell in Excel? -


i'm working on excel i've few columns. make sql insert operation records in sheet.

there chances of cell empty , unable continue. need check:

if(cell empty)     insert null  else    insert value 

how can implement inside formula?

=concontenate("insert table values"("a1,if(a2="",null,"'","a2","'"))

correct me if wrong

one example of working function be:

=concatenate("insert table mytable (col1, col2) values ('", a2, "', ", if(isblank(b2), "null", concatenate("'", b2, "'")), ")") 

this assumes inserting 2 values same excel row, adds quotes around values allow insert text strings, , replaces blank values null. if() statement contains own concatenate() add quotes around value if exists (you wouldn't want quotes around null value).

the screenshot below shows setup , results:

enter image description here


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -