Excel - 返回列的第一个负数 [英] Excel - Return the first negative number of a column

查看:339
本文介绍了Excel - 返回列的第一个负数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Excel 2010,我正在寻找一种方法来返回列的第一个负数。例如,我在列中分配了以下数字:
1
4
6
-3
4
-1
- 10
8
我可以使用哪个函数返回-3?
Thanks!

解决方案

这可以用两种方法解释......如果所有数字都在单个单元格中一列)作为字符串,可以使用MID功能。如果数字在A1中,那么可以使用的公式是:

  = VALUE(MID(A1,SEARCH( - ,A1),SEARCH(,A1,SEARCH( - ,A1)) -  SEARCH( - ,A1)))

如果每个数字都在自己的列中(在我的示例中为A3:H3),则必须使用不同的技术:

  {= INDEX(A3:H3,1,MATCH(TRUE,A3:H3 <0,0))} 

不要输入{} - 使用 CTRL + SHIFT + ENTER <

在每种情况下,公式都会返回数字-3,这是系列中的第一个负数。


I'm using Excel 2010 and I'm looking for a way to return the first negative number of a column. For instance, I have the following numbers distributed in a column: 1 4 6 -3 4 -1 -10 8 Which function could I use to return -3? Thanks!

解决方案

This could be interpreted two ways... If all the numbers are in a single cell (one column) as a string, the MID function can be used. If the numbers are in A1, a formula that could work is this:

=VALUE(MID(A1,SEARCH("-",A1),SEARCH(" ",A1,SEARCH("-",A1))-SEARCH("-",A1)))

If the numbers are each in their own columns (in my example, A3:H3), a different technique must be used:

{=INDEX(A3:H3,1,MATCH(TRUE,A3:H3<0,0))}

Don't type the { } - enter the equation using CTRL+SHIFT+ENTER.

In each case, the formula will return the number -3, which is the first negative number in the series.

这篇关于Excel - 返回列的第一个负数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆