close

I have a very lengthy column which includes data of various sorts: some cells
are textual, some have dates, and others are numbers. I need to add the
values in only the cells that have numbers. The SUM formula disregards text,
so those cells don't pose a problem, but the date cells skew my results if I
use some (since they get included in their converted representation).

Is there an easy way to add only numerical (ie, non-date and non-textual)
values?

On a similar note: Is there a quick way to count the cells that have text in
them? I don't need a sum in this case: Just a count of the cells.

Thanks!

The problem is that to Excel a date is just a number, so how could you
exclude one number and not another?

Numbers that represent recent dates are all in the 38,000 range (eg
today is 38811), so if the other numbers are very much lower than this,
then you could make use of this to exclude the dates, eg something
like:

=SUMIF(A1:A1000,quot;lt;quot;35000,A1:A1000)

if the column with the mixed data is A.

Hope this helps.

PeteCells formatted as date can be identified with the CELL(ref, quot;formatquot;)
formula. FOr example, if cell A2 contains 3-mar-06, then

=CELL(A2,quot;formatquot;)

will return quot;D1quot;. All date format codes start with quot;Dquot;. Hence you can
use something like:

=SUMPRODUCT(A2:A100,--(LEFT(CELL(A2:A100,quot;formatquot;),1)lt;gt;quot;Dquot;))

Does this help?

Kostis VezeridesBetween your reply and the other one just above, I'm on the right track. It's
actually kind of a relief that there wasn't some incredibly obvious solution
I was simply too stupid to know. Thanks!

quot;vezeridquot; wrote:

gt; Cells formatted as date can be identified with the CELL(ref, quot;formatquot;)
gt; formula. FOr example, if cell A2 contains 3-mar-06, then
gt;
gt; =CELL(A2,quot;formatquot;)
gt;
gt; will return quot;D1quot;. All date format codes start with quot;Dquot;. Hence you can
gt; use something like:
gt;
gt; =SUMPRODUCT(A2:A100,--(LEFT(CELL(A2:A100,quot;formatquot;),1)lt;gt;quot;Dquot;))
gt;
gt; Does this help?
gt;
gt; Kostis Vezerides
gt;
gt;

Thanks! The two replies I've gotten have clarified things quite a bit--though
working with dates in Excel always strikes me as a bit complex. Thanks again!

quot;Pete_UKquot; wrote:

gt; The problem is that to Excel a date is just a number, so how could you
gt; exclude one number and not another?
gt;
gt; Numbers that represent recent dates are all in the 38,000 range (eg
gt; today is 38811), so if the other numbers are very much lower than this,
gt; then you could make use of this to exclude the dates, eg something
gt; like:
gt;
gt; =SUMIF(A1:A1000,quot;lt;quot;35000,A1:A1000)
gt;
gt; if the column with the mixed data is A.
gt;
gt; Hope this helps.
gt;
gt; Pete
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()