在删除文本时复制单元格内容的Excel公式

时间:2018-10-23 19:39:49

标签: excel-formula

我需要一个公式,该公式将A1复制到B1,同时删除“ -text3”(第二个破折号和其后的文本。“ text-text-text”格式在A列中保持一致)。 text1,text2和text3分别表示各种不一致的字符串。

function d($var){var_dump($var);}

$woocommerce = new Client(
    "https://{$domain}.com/", 
    $ckey, 
    $csec, 
    array( 'wp_api' => true
         ,'version' => 'wc/v2' 
         ,'verify_ssl' => false
         ,'queryStringAuth' => false
        )
);

try {
   $results = $woocommerce->get('orders');
} catch (HttpClientException $e) {
   d( $e->getMessage() );
        // Error: Sorry, you cannot list resources. [woocommerce_rest_cannot_view]
   d(  $e->getRequest()->getUrl() );
        // https://example.com/wp-json/wc/v2/orders 
   d(  $e->getRequest()->getparameters() ); 
       // empty array 
}


$res = json_decode(file_get_contents("https://{$domain}.com/wp-json/wc/v2/orders?consumer_key={$ckey}&consumer_secret={$csec}&per_page=99"));
d($res );
// works, full list of orders.

1 个答案:

答案 0 :(得分:2)

使用:

=LEFT(A1,FIND("}}}",SUBSTITUTE(A1,"-","}}}",2))-1)

enter image description here