+ Reply to Thread
Results 1 to 4 of 4

=IF formula help

  1. #1
    Registered User
    Join Date
    06-23-2019
    Location
    uk
    MS-Off Ver
    2010
    Posts
    2

    =IF formula help

    if cell c2 contains "weekly" then cell g2 returns certain formula. however if cell c2 contains "monthly" or "yearly" then another formula is returned. currently just returns false. this is the formula i am currently trying

    =IF(C2="Weekly",B2*52,0 =IF(C2="Monthly",B2*12,0 =IF(C2="Yearly",B2*1,0)))

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: =IF formula help

    Welcome to the forum!

    Try this:

    =IF(C2="Weekly",B2*52,IF(C2="Monthly",B2*12,IF(C2="Yearly",B2*1,0)))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-23-2019
    Location
    uk
    MS-Off Ver
    2010
    Posts
    2
    Quote Originally Posted by AliGW View Post
    Welcome to the forum!

    Try this:

    =IF(C2="Weekly",B2*52,IF(C2="Monthly",B2*12,IF(C2="Yearly",B2*1,0)))
    Thanks that works perfectly. Is the only difference that you didn't put the false value until the end?

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

    Re: =IF formula help

    Is the only difference that you didn't put the false value until the end?
    The problem with your formula was that you put in an "out" right away into the IF/THEN formula.
    in your formula =IF(C2="Weekly",B2*52,0 =IF you essentially wrote that IF C2 = Weekly you wanted B2 to be multiplied by 52. IF it didn't equal weekly then make the output zero. So the formula had no reason to go beyond that point so the next IF formula was irrelevant because all conditions were satisfied initially.
    BTW, this is a little shorter as a formula from what Ali gave you... =IF(C2="Weekly",B2*52,IF(C2="Monthly",B2*12,IF(C2="Yearly",B2,0))) Because the B2*1 is the same as B2.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

+ 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. Replies: 3
    Last Post: 01-10-2019, 09:34 AM
  2. Replies: 5
    Last Post: 02-16-2018, 06:50 AM
  3. Replies: 8
    Last Post: 09-22-2017, 05:41 AM
  4. 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
  5. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  6. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 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