+ Reply to Thread
Results 1 to 13 of 13

Multiplying Cell by a variable factor

  1. #1
    Registered User
    Join Date
    07-07-2015
    Location
    Egypt
    MS-Off Ver
    2010
    Posts
    23

    Multiplying Cell by a variable factor

    Hello all, nice to see you again

    I have a calculating sheet with some variables data, where D1 is a drop down list, what I need to do is as follows:

    If D1 = A, then F1=E1*1.0
    and If D1 = B, then F1=E1*1.2
    and If D1 = B, then F1=E1*1.3
    and If D1 = B, then F1=E1*1.4

    how can I do that?

    Thanks in advance.

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Multiplying Cell by a variable factor

    Hi,

    Give this a try:

    Please Login or Register  to view this content.
    Cheers

  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
    53,048

    Re: Multiplying Cell by a variable factor

    Quote Originally Posted by southward View Post
    Hi,

    Give this a try:

    Please Login or Register  to view this content.
    Cheers
    1st, this can be shortened to this...
    =IF(d1="","",e1*if(D1="A",1,IF(D1="B",1.2,IF(D1="C",1.3,IF(D1="D",1.4,"")))))

    2nd, I would probably do this with a small table containing each variable and it's value, then use a vlookup to bring back the answer. This has the advantage of letting you add more variables and/or adjusting their value, without messing with the forula
    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 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,465

    Re: Multiplying Cell by a variable factor

    One way:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    which assumes upper case letters will be selected from the list.
    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


  5. #5
    Registered User
    Join Date
    07-07-2015
    Location
    Egypt
    MS-Off Ver
    2010
    Posts
    23

    Thumbs up Re: Multiplying Cell by a variable factor

    Thanks Southward
    worked Perfectly

  6. #6
    Registered User
    Join Date
    07-07-2015
    Location
    Egypt
    MS-Off Ver
    2010
    Posts
    23

    Re: Multiplying Cell by a variable factor

    Thank you all guys
    all worked very nice

  7. #7
    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
    53,048

    Re: Multiplying Cell by a variable factor

    Trevor, I have not seen CODE before, looks useful. Is it available in 2010?

  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,465

    Re: Multiplying Cell by a variable factor

    @Ford: as far as I am aware, it is available in all versions.

  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,465

    Re: Multiplying Cell by a variable factor

    @Kappany: You're welcome. Thanks for the rep.

  10. #10
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Multiplying Cell by a variable factor

    Or, if you expect or plan to expand your variable data you can use a VLOOKUP with a table.

    Something like this:

    Please Login or Register  to view this content.
    a 1
    b 1.2
    c 1.3
    d 1.4

    Just add to the table and update the formula.
    Can prove to more efficient than editing individual formulas if changes need to be made.

    Cheers



    p.s.

    @FDibbins,

    Sorry, didn't see your second suggestion regarding using a table and Vlookup before posting. Just read back through the post. Good idea by the way.
    Last edited by southward; 05-29-2016 at 11:15 PM. Reason: added a p.s.

  11. #11
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Multiplying Cell by a variable factor

    Glad I could be of some assistance

  12. #12
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,054

    Re: Multiplying Cell by a variable factor

    Or this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Never use Merged Cells in Excel

  13. #13
    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
    53,048

    Re: Multiplying Cell by a variable factor

    Happy to help guys, thanks for the feedback

+ 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. Multiply a black cell by a factor
    By PrintingPost in forum Excel General
    Replies: 5
    Last Post: 12-29-2015, 05:45 PM
  2. Multiplying Existing Table by a Factor Using a Lookup
    By clueless12 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-28-2015, 05:56 PM
  3. [SOLVED] Factor Up and Factor Down Values Formula
    By alive555 in forum Excel General
    Replies: 6
    Last Post: 08-14-2015, 12:01 PM
  4. [SOLVED] Multiple a cell value by a different factor, depending on value range of cell.
    By CraigST in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-04-2015, 09:05 PM
  5. [SOLVED] Multiplying number with an alphabet that is a variable
    By faysaal in forum Excel General
    Replies: 8
    Last Post: 09-27-2014, 10:23 AM
  6. Multiplying as a variable of IF
    By rwbaldwin0728 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-28-2013, 01:33 PM
  7. Multiplying each cell in a selection by a variable
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2012, 11:40 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