问题描述
我正在尝试将列表中的名称转换为数字我有一个标题为 Name 的列,它包含多个名称,我想创建一个列,该列将采用名称列中的名称并将其更改为数字,这个公式有效 <?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
internalLogLevel="info"
internalLogFile="C:\temp\fallback-log.txt"
throwConfigExceptions="true">
<extensions>
<add assembly="NLog.Web.AspNetCore"/>
<add assembly="NLog.Extensions.AzureBlobStorage" />
</extensions>
<targets async="true">
<target
xsi:type="AzureBlobStorage"
name="azure"
layout="${longdate:universalTime=true} ${level:uppercase=true} - ${logger}: ${message} ${exception:format=tostring}"
connectionString="your-connection-string-goes-here"
container="logs"
blobName="${date:universalTime=true:format=yyyy-MM-dd}.log" />
</targets>
<rules>
<logger name="*" minlevel="Trace" writeto="azure" />
</rules>
</nlog>
如果我想添加更多的名字,例如数字它不起作用,我的公式如下。
=IF(Name="Jhon","2")
谢谢。
解决方法
公式应该是这样的:
=IF(Name ="Jhon","2",IF(Name ="Mike","1",IF(Name ="Jane","3")))
更多,你可以参考这篇文章:
https://support.microsoft.com/en-us/office/if-function-7025be14-5665-43d0-af20-8293d1fe9d3a