+ Reply to Thread
Results 1 to 7 of 7

Formating cells with certain formula

  1. #1
    Forum Contributor
    Join Date
    01-15-2008
    Posts
    140

    Formating cells with certain formula

    I have a column of cells in worksheet "B" that has this formula to fill those cells with data from another worksheet, "2010H&A":

    =REPT(INDEX('2010 H&A'!$F$7:$F$643,MATCH($B9&":"&$C9&":"&$F9,'2010 H&A'!$P$7:$P$643,0)),1)

    I am using the number format where a positive number is in black and a negative number is in red with (). Example 3.5 appears as 3.5 and -3.5 appears as (3.5) in red. With the above formula, when I enter -3.5 in the cell in worksheet "2010H&E" it presents correctly in that cell as (3.5) in red, but in the corresponding cell in worksheet "B" it appears as -3.5 in black. I have of course tried several times to format the column of cells in worksheet "B" the same as the number format in worksheet "2010H&E", but it does not work. Can you help?
    Last edited by tomvh444; 08-27-2011 at 12:17 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,946

    Re: Formating cells with certain formula

    Might be helpful to post a sample workbook.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    01-15-2008
    Posts
    140

    Re: Formating cells with certain formula

    Not sure how I attach a workbook

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,946

    Re: Formating cells with certain formula

    click on Go Advanced.
    click on thr paperclip icon.
    click on browse.
    navigate to your folder/file
    select the file
    click on upload
    close the window
    submit

    Regards

  5. #5
    Forum Contributor
    Join Date
    01-15-2008
    Posts
    140

    Re: Formating cells with certain formula

    Thanks for the instruction, I had not done an attachment on this forum before. Here it is. As you look at the workbook, you will see in worksheet "2010 H&A under column F the negative numbers are formatted to appear in red with the ( ). In worksheet "2010away T1" those numbers are presented in column G, but the negative numbers present as -3.5 etc. This is not a "must have", but I would prefer to have all my negative numbers appear in red and the positive numbers in black.
    Attached Files Attached Files

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formating cells with certain formula

    REPT is a TEXT based function so it returns strings rather than numbers and as such number formats are ignored.

    For the sake of Column G modify the formula to:

    Please Login or Register  to view this content.
    at which point your existing number formats should take effect and Null strings will be returned as appropriate.

  7. #7
    Forum Contributor
    Join Date
    01-15-2008
    Posts
    140

    Thumbs up Re: Formating cells with certain formula

    Sorry for the delay in my response. I had a sudden illness and am just now back up and running. I will make the change from TEXT and thank you so much.

+ 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