+ Reply to Thread
Results 1 to 4 of 4

calculated columns : comparing a column with a text value.

  1. #1
    Registered User
    Join Date
    12-05-2013
    Location
    asdf
    MS-Off Ver
    Excel 2010
    Posts
    1

    calculated columns : comparing a column with a text value.

    Guys,

    I am using pivot tables trying to create a calculated column on "column1" which is text column in the excel sheet and below is the logic:
    if column1 is equal to "Tier1" then return 1 or return 0

    so i write this as

    IF(Column1 = "Tier1",1,0)

    for the life of me this always return a 0 and never a 1, even though the value of Column1 is Tier1 with no spaces and same case.

    does any one know what i might be doing wrong here.

    thanks

  2. #2
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: calculated columns : comparing a column with a text value.

    Hi Kryptonite,

    Welcome to the forum! If this is outside the Pivot Table, "Column1" is not a valid reference in an IF statement, you need to refer to a cell.

    Try =IF(A1="Tier1",1,0) where you are looking at the value in A1.
    Last edited by David A Coop; 12-05-2013 at 08:08 PM.

  3. #3
    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,939

    Re: calculated columns : comparing a column with a text value.

    Hi and welcome to the forum

    As david pointed out, column1 is not a cell ref (unless it is a named range?).
    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

  4. #4
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: calculated columns : comparing a column with a text value.

    Quote Originally Posted by David A Coop View Post
    Hi Kryptonite,

    Welcome to the forum! If this is outside the Pivot Table, "Column1" is not a valid reference in an IF statement, you need to refer to a cell.

    Try =IF(A1="Tier1",1,0) where you are looking at the value in A1.
    Hello again, it occurred to me that you are trying to calculate the formula WITHIN the Pivot Table. I don't know how to do this, I think it would be better to have a helper column outside the PT, and include that column in the table. You could pick up the number with =VALUE(RIGHT(A2,1)) if you have less than 10 Teirs.

    How many Tiers are there?

+ 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. Replies: 1
    Last Post: 02-05-2013, 10:56 AM
  2. [SOLVED] Comparing 2 columns and deleting duplicates in the second column according first column
    By wingo033 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-19-2012, 07:14 PM
  3. [SOLVED] IF AND or SUMIFS comparing Months from 2 date columns and text from 2 other columns
    By jrochet in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-22-2012, 11:06 AM
  4. Comparing text columns
    By kpmunt in forum Excel General
    Replies: 2
    Last Post: 09-29-2008, 10:06 PM
  5. Comparing Two Columns of Text
    By sailortigger in forum Excel General
    Replies: 2
    Last Post: 06-21-2005, 03:11 PM

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