+ Reply to Thread
Results 1 to 8 of 8

if function for 2 conditions and multiply by different cells

  1. #1
    Registered User
    Join Date
    11-02-2017
    Location
    singapore
    MS-Off Ver
    2016
    Posts
    5

    if function for 2 conditions and multiply by different cells

    Hello everyone!

    I need to lookup this cell - at R1 "USD" or "EURO"
    if "USD", A2*R2
    if "EURO", B2*R2

    below is my first part of formula but i do not know how to write the second part.
    =IF($R$1="usd",A2*$R$2)

    thank you in advance. =)
    Last edited by kevin1979; 11-02-2017 at 03:04 AM.

  2. #2
    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,049

    Re: need help on excel formula

    Hi, welcome to the forum

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (note: this change is not optional )

    (just add the 2nd part, like you have it)
    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

  3. #3
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,999

    Re: need help on excel formula

    Try

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  4. #4
    Registered User
    Join Date
    11-02-2017
    Location
    singapore
    MS-Off Ver
    2016
    Posts
    5

    Re: need help on excel formula

    ops, sorry for not reading the rules. =(
    I tried to search for the same "problem" in google and forum but unable to find it. that's why i created a account to seek for help.
    noted, i will change the title.
    thank you. =)

  5. #5
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,999

    Re: if function for 2 conditions and multiply by different cells

    Try

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

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    wales
    MS-Off Ver
    Excel 2007
    Posts
    964

    Re: if function for 2 conditions and multiply by different cells

    why would you need the second IF function? wouldn't a standard IF work

    Please Login or Register  to view this content.
    unless you want it to only do the calculation if the cell has the USD or EURO part included.

    an important thing to remember is to try and stream line your formulas and adding in a lot of IF functions can make something simple and fast in to something slow and complicated.
    The Importance of INDEX - A GUIDE TO INDEX'S OTHER USES
    <--- If a post helps hit the star

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,963

    Re: if function for 2 conditions and multiply by different cells

    You can also use the INDIRECT function instead of the IF formula.
    1. Name cell A2 "USD" AND B2 to "EURO"
    2. Dropdown selection in R1 to select USD/EURO, etc.
    3. Cell R2 holds value to be multiplied
    4. Result in S2 using:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ben Van Johnson

  8. #8
    Registered User
    Join Date
    11-02-2017
    Location
    singapore
    MS-Off Ver
    2016
    Posts
    5

    Re: if function for 2 conditions and multiply by different cells

    Thank you guys. My problem solved.

+ 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] VBA, User-defined formula argument referring to cell value calculated by Excel formula
    By ARAGORN II in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2017, 01:57 PM
  2. Excel formula bar to display the result of the formula , not the formula?
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2016, 07:15 PM
  3. Replies: 10
    Last Post: 12-16-2015, 03:16 PM
  4. Replies: 2
    Last Post: 03-21-2014, 11:43 AM
  5. Macro: Applying formula to multiple cells in excel (formula editing)
    By city in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-27-2012, 06:41 AM
  6. Replies: 0
    Last Post: 03-19-2012, 07:32 PM
  7. Replies: 1
    Last Post: 03-04-2012, 12:03 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