Patrick:
as an aside to Hemanshu's helpful guidance, check if your -"n.a."- has leading and/or trailing blanks.
as an aside to Hemanshu's helpful guidance, check if your -"n.a."- has leading and/or trailing blanks.
. dataex NetInterestRevenuethEUR2020 - OperatingrevenuesthEUR2020 in 1/5 * Example generated by -dataex-. For more info, type help dataex clear input str17(NetInterestRevenuethEUR2020 Netinterestincomeexpenseth) str18 OperatingrevenuesthEUR2020 "19286000" "19286000" "41779000" "n.a." "n.a." "n.a." "11818000" "11818000" "20500000" "31994000" "31994000" "46717000" "10473000" "10473000" "22113000" end
import excel using "path_to_excel_file", firstrow clear foreach var of varlist * { capture confirm string var `var' if !_rc { replace `var' = "" if `var'=="n.a." destring `var', replace } }
replace `var' == "" if ...
Comment