+ Reply to Thread
Results 1 to 7 of 7

Format a column with two different formats based on value in another col

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Format a column with two different formats based on value in another col

    See enclosed file sheet1.

    I have a column (Calc4) where i want to format this column with two different formats based on the values in Calc1 column. For the different formats see enclosed file. Is this even possible?
    Attached Files Attached Files
    Last edited by NBVC; 10-03-2011 at 01:32 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Format a column with two different formats based on value in another col

    Do you mean?

    =IF(B2="",D2/100,IF(C2=0,0,D2/C2))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Format a column with two different formats based on value in another col

    Its not very clear regarding what formats you need and how many. If we know we can help you decide if you need a conditional formatting or macro.

  4. #4
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: Format a column with two different formats based on value in another col

    Hi
    Format coloum E as General and give the formula
    =IF(B2="",D2,TEXT(IF(OR(C2=0,ISERROR(D2/C2)),"",D2/C2),"#.#%"))

  5. #5
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Format a column with two different formats based on value in another col

    no not exactly. Sorry my explanation was not very good.

    Basically, its this.

    If value in colB is "blank" AND there is a value is colD of say 65............then i want column E to show "65 Qry".

    If value in colB is not empty AND ColC and ColD are not empty then i want to show value of D/C as a percentage withone decimal place.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Format a column with two different formats based on value in another col

    A little adjustment...

    =IF(B2="",D2&" Qry",IF(C2=0,0,D2/C2))

  7. #7
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Format a column with two different formats based on value in another col

    that will work.

    I feel kinda stupid.......i should have known that.........thanks a lot.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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