使用特定条件返回所有值

时间:2018-08-14 19:58:00

标签: excel excel-formula array-formulas

我需要有关创建Excel公式的帮助。我在第1行中有一个名称列表,在第2行中有一个值列表。我需要一个公式,该公式将返回第1行中第2行中具有特定值的所有名称(让我们称之为“ value1”)。我知道如何使用VBA做到这一点,但我宁愿避免使用宏(如果可能)。我很确定数组公式可以实现这一点,但是我对它不是很满意,因此我将不胜感激。

1 个答案:

答案 0 :(得分:1)

类似这样的东西:

Main has thrown an exception

Source: System.Core

Message: Method 'Newtonsoft.Json.Linq.JToken get_Item(System.String)' declared on type 'Newtonsoft.Json.Linq.JObject' cannot be called with instance of type 'Newtonsoft.Json.Linq.JObject'

Exception Type: ArgumentException

System.ArgumentException: Method 'Newtonsoft.Json.Linq.JToken get_Item(System.String)' declared on type 'Newtonsoft.Json.Linq.JObject' cannot be called with instance of type 'Newtonsoft.Json.Linq.JObject'
   at System.Linq.Expressions.Expression.ValidateCallInstanceType(Type instanceType, MethodInfo method)
   at System.Linq.Expressions.Expression.ValidateStaticOrInstanceMethod(Expression instance, MethodInfo method)
   at System.Linq.Expressions.Expression.Call(Expression instance, MethodInfo method, IEnumerable`1 arguments)
   at Microsoft.VisualBasic.Activities.VisualBasicHelper.Rewrite(Expression expression, ReadOnlyCollection`1 lambdaParameters, Boolean isLocationExpression, Boolean& abort)
   at Microsoft.VisualBasic.Activities.VisualBasicHelper.Rewrite(Expression expression, ReadOnlyCollection`1 lambdaParameters, Boolean& abort)
   at Microsoft.VisualBasic.Activities.VisualBasicHelper.Rewrite(Expression expression, ReadOnlyCollection`1 lambdaParameters, Boolean isLocationExpression, Boolean& abort)
   at Microsoft.VisualBasic.Activities.VisualBasicHelper.Rewrite(Expression expression, ReadOnlyCollection`1 lambdaParameters, Boolean& abort)
   at Microsoft.VisualBasic.Activities.VisualBasicHelper.Rewrite(Expression expression, ReadOnlyCollection`1 lambdaParameters, Boolean isLocationExpression, Boolean& abort)
   at Microsoft.VisualBasic.Activities.VisualBasicHelper.Compile[T](LocationReferenceEnvironment environment, Boolean isLocationReference)
   at Microsoft.VisualBasic.Activities.VisualBasicHelper.Compile[T](CodeActivityPublicEnvironmentAccessor publicAccessor, Boolean isLocationReference)
   at Microsoft.VisualBasic.Activities.VisualBasicHelper.Compile[T](String expressionText, CodeActivityPublicEnvironmentAccessor publicAccessor, Boolean isLocationExpression)
   at Microsoft.VisualBasic.Activities.VisualBasicValue`1.CacheMetadata(CodeActivityMetadata metadata)
   at System.Activities.CodeActivity`1.OnInternalCacheMetadataExceptResult(Boolean createEmptyBindings)
   at System.Activities.Activity`1.OnInternalCacheMetadata(Boolean createEmptyBindings)
   at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList`1& validationErrors)
   at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack`1& activitiesRemaining, ActivityCallStack parentChain, IList`1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback)
   at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
   at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
   at System.Activities.Hosting.WorkflowInstance.ValidateWorkflow(WorkflowInstanceExtensionManager extensionManager)
   at System.Activities.Hosting.WorkflowInstance.RegisterExtensionManager(WorkflowInstanceExtensionManager extensionManager)
   at System.Activities.WorkflowApplication.EnsureInitialized()
   at System.Activities.WorkflowApplication.Enqueue(InstanceOperation operation, Boolean push)
   at System.Activities.WorkflowApplication.SimpleOperationAsyncResult.Run(TimeSpan timeout)
   at System.Activities.WorkflowApplication.BeginRun(AsyncCallback callback, Object state)
   at UiPath.Executor.RobotRunner.<>c__DisplayClass54_0.<OnInvokeJob>b__0()

enter image description here

当它被向下复制时,选择将改变。