+ Reply to Thread
Results 1 to 10 of 10

IF formula, value from another cell.

  1. #1
    Registered User
    Join Date
    07-12-2015
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    18

    IF formula, value from another cell.

    Hi,

    I have a table like this:

    Header 1 Header 2 Header 3
    1 - 20
    2 20 30
    3 30 50
    4 - 40

    I would need a formula that replaces all "-" in Header 2 with the value in the cell next to it (Header 3).

    See below:

    Header 1 Header 2 Header 3
    1 20 20
    2 20 30
    3 30 50
    4 40 40

    Any simple Formulas for this? I have tried for a while now but can't seem to get it to work properly.

    Thank you.
    Last edited by wearonourway; 07-20-2015 at 10:47 AM. Reason: Hope you understand it, even though my table got a bit different compared to when I previewed it.

  2. #2
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: IF formula, value from another cell.

    say header 2 is in column B

    -IF(b1="-",C1,b1)
    If I've helped U pls click on d *Add Reputation

  3. #3
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: IF formula, value from another cell.

    Another option if header 2 is in column B...
    Place this in B1 and drag down...
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    Either one should work...if I understand what the results you want are correctly.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  4. #4
    Registered User
    Join Date
    07-20-2015
    Location
    Chennai
    MS-Off Ver
    2007
    Posts
    1

    Re: IF formula, value from another cell.

    So I have to add one more column between Header 2 & 3 and then use this formula. Is my understanding right?

  5. #5
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: IF formula, value from another cell.

    Yes. or you may use the next available column then copy paste the results

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: IF formula, value from another cell.

    With my formula, you wont have to add another column

  7. #7
    Registered User
    Join Date
    07-12-2015
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: IF formula, value from another cell.

    Quote Originally Posted by bhenlee View Post
    say header 2 is in column B

    -IF(b1="-",C1,b1)
    Quote Originally Posted by gmr4evr1 View Post
    Another option if header 2 is in column B...
    Place this in B1 and drag down...
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    Either one should work...if I understand what the results you want are correctly.
    Thanks for your suggestions, however I can't seem to get it to work properly when I "drag down" the formula.

    I have uploaded a sample file, if anyone wants to have a go.

    Attachment 408393

  8. #8
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: IF formula, value from another cell.

    in cell D2 copy & paste this formula:

    =IF(B2="-",C2,B2)

    then copy the result on column D and paste it on column B

  9. #9
    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,933

    Re: IF formula, value from another cell.

    If you are using a helper, put this in it and copy down...
    =ABS(A1)
    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

  10. #10
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: IF formula, value from another cell.

    My mistake. Mine will only work if the data is already filled in. If it's not and it is manually (or otherwise) placed into the cell, it removes the formula. Sorry about that.

  11. #11
    Registered User
    Join Date
    07-12-2015
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: IF formula, value from another cell.

    Quote Originally Posted by bhenlee View Post
    in cell D2 copy & paste this formula:

    =IF(B2="-",C2,B2)

    then copy the result on column D and paste it on column B
    I understand now and got it working. But I am looking for a solution where I don't need to use a helper column.

    Let me explain. I want to update two certain columns with raw data every month. The right column always have a value like 50, 40, 30 etc. No problem there. The left column also got values, but a few doesn't have values and "-" is displayed in the cell. For these ones only I want to replace the "-" with the value that is right next to it in the right column. Like IF "-" is found, copy the value that is in the column to the right and replace "-". IF no "-" is found then do nothing. Thanks for your help and patience.

+ 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. [SOLVED] Enter formula result from one cell into a COUNTIF formula in another cell. Help please!
    By gregrach in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-10-2014, 11:23 AM
  2. Replies: 0
    Last Post: 03-20-2014, 10:57 AM
  3. [SOLVED] Retaining formula cell references when copying a formula to a different cell
    By FrankParisi in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2013, 07:05 AM
  4. Replies: 5
    Last Post: 05-07-2013, 08:34 AM
  5. Change Cell Font Color if Cell Contains Formula Referencing Another Cell
    By wilcox.patrick in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-10-2012, 10:24 PM
  6. Replies: 2
    Last Post: 03-07-2008, 08:05 PM
  7. Replies: 3
    Last Post: 07-10-2007, 04:57 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