+ Reply to Thread
Results 1 to 9 of 9

Changing cell source

  1. #1
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    1,003

    Changing cell source

    Simple one (I'm sure) for you on here. I have a formula, =IF(C2=1,D2*C5+E2*E5,0) that's works just fine if C2=1. Is it possible to have a single formula that would work if C2 was to equal 2,3 or 4?

    Basically if I could I would have 4 formulas in the same cell they would be =IF(C2=1,D2*C5+E2*E5,0) =IF(C2=2,D2*C6+E2*E6,0) =IF(C2=3,D2*C7+E2*E7,0) =IF(C2=4,D2*C8+E2*E8,0)

    Thanking you in anticipation
    Last edited by Marvo; 04-11-2016 at 05:50 AM.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,682

    Re: Changing cell source

    well this should do it ... =IF(C2=1,D2*C5+E2*E5,IF(C2=2,D2*C6+E2*E6,IF(C2=3,D2*C7+E2*E7,IF(C2=4,D2*C8+E2*E8,0)))
    (not tested)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    1,003

    Re: Changing cell source

    I've just tried this

    =IF(B2=1,C2*C5+D2*D5)=IF(B2=2,C2*C6+D2*D6)=IF(B2=3,C2*C7+D2*D7)=IF(B2=4,C2*C6+D2*D6,0)

    But it results in FALSE

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,682

    Re: Changing cell source

    but that isn't what I gave you. this is what I gave you...
    =IF(C2=1,D2*C5+E2*E5,IF(C2=2,D2*C6+E2*E6,IF(C2=3,D2*C7+E2*E7,IF(C2=4,D2*C8+E2*E8,0)))

  5. #5
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    1,003

    Re: Changing cell source

    That works a treat. Thank you very much.

  6. #6
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    1,003

    Re: Changing cell source

    Sorry, I posted my first reply before I saw your response. Again, thank you.

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,682

    Re: Changing cell source

    You're welcome! Glad it worked for you. And thank you for the rep!

  8. #8
    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
    48,050

    Re: Changing cell source

    One way:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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


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

    Re: Changing cell source

    Or
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. Changing Data Source
    By KaelVonrik in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-25-2016, 02:07 PM
  2. [SOLVED] Changing powerpivot source
    By stephme55 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-27-2016, 03:57 AM
  3. Replies: 2
    Last Post: 10-30-2015, 01:15 PM
  4. Change Chart Source Data series by changing cell
    By Hendra S in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-10-2014, 02:09 PM
  5. [SOLVED] Changing Pivot Table Source Week using a reference cell
    By interested in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-07-2013, 06:12 AM
  6. Replies: 8
    Last Post: 01-11-2013, 11:21 PM
  7. linking to a changing source
    By carverlee in forum Excel General
    Replies: 2
    Last Post: 05-14-2010, 05:04 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