+ Reply to Thread
Results 1 to 4 of 4

Is there a function in excel that clears an entire column or sets it to zero temporarily?

  1. #1
    Registered User
    Join Date
    12-27-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Is there a function in excel that clears an entire column or sets it to zero temporarily?

    Fairly new to excel and am stuck with a problem that should be fairly easy.
    I am doing a calculation in one column that involves a variable that is the sum of a separate column. In a third column if "Y" is typed I need that variable to be set to zero, so I have tried an if statement that if "Y" is typed all cells are set to zero.. But once a "Y" has been typed all the cells are =0 and thats it! I need a function that will clear all the cells when "Y" and then continue to add the following data as it is entered into the column, and then the column cleared when "Y"?

    Is there a function in excel that clears an entire column or sets it to zero temporarily?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Is there a function in excel that clears an entire column or sets it to zero temporari

    Hi and welcome ot the forum

    Not sure what your formula was, but try this...

    =IF(C2="Y",0,your-formula)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    12-27-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Is there a function in excel that clears an entire column or sets it to zero temporari

    Quote Originally Posted by FDibbins View Post
    Hi and welcome ot the forum

    Not sure what your formula was, but try this...

    =IF(C2="Y",0,your-formula)

    That is the gist of what I'm doing but not quite what I need.

    In column A I have a formula that contains a variable C19 >>> [SUM(C1:C18)]

    In column B the input is "Y" or "N"

    Whenever "N" is typed nothing is to happen...The data is entered down column C and is then summed at the end.

    Whenever "Y" is typed I need C1:C18 = 0 (The variable in the formula needs to be zero)

    Using an IF statement to do this is the problem because because if you type "Y" in B1 then C1:C18 = 0 and any data entered after a "Y" is typed is just zero.

    I'm finding it hard to explain but I need a function or code that will allow me to SUM a column of numbers but clear the column when "Y" and then continue to sum until "Y" and so on....

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Is there a function in excel that clears an entire column or sets it to zero temporari

    If you can post a SMALL sample file showing your expected results it might help us better understand what you're trying to do.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Temporarily highlight column for data input
    By Leif Magnus in forum Excel General
    Replies: 2
    Last Post: 11-15-2012, 06:16 PM
  2. Replies: 6
    Last Post: 05-17-2012, 12:07 PM
  3. Temporarily Changing Cell Inputs To Yield Different Function Outputs
    By Asher_ in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-17-2011, 04:28 PM
  4. How do I apply a function to an entire column?
    By didja in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-23-2005, 01:10 AM
  5. [SOLVED] refresh of pivot table clears fields (column headers)
    By Leejo in forum Excel General
    Replies: 0
    Last Post: 10-12-2005, 11:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1