+ Reply to Thread
Results 1 to 8 of 8

Understanding this If Statement formula

  1. #1
    Forum Contributor
    Join Date
    01-06-2015
    Location
    Huntsville, AL
    MS-Off Ver
    Office 365
    Posts
    185

    Understanding this If Statement formula

    I'm trying to determine exactly what this formula is doing. I know that if Cell "A2" equals the desired text it completes the rest and if it doesn't it returns 0. I also understand that if cell B2 isn't greater than 15 it returns back 15. I also understand that if cell B2 is between 16-35 it returns a value of 25. I also see that anything greater than 35 it returns back 35. I guess my bigger question, is there a way to rewrite this? TIA

    Please Login or Register  to view this content.

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,558

    Re: Understanding this If Statement formula

    It doesn't really make sense - what is it suppoised to do?
    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
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Understanding this If Statement formula

    is there a way to rewrite this?
    Yes, this formula does the same:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-06-2015
    Location
    Huntsville, AL
    MS-Off Ver
    Office 365
    Posts
    185

    Re: Understanding this If Statement formula

    In a nutshell it is used to determine the lot size for manufacturing purposes. It's looking at the number of pieces that can be built in "X' amount of hours and then it determines how to set the lot size to be built. It says if the qty is less than 15, build 15. If it's greater than 15 but not greater than 35 build 25 and if it's more than 35 then build lots of 35. I'm recreating a sheet and wanted to understand it a little more. I have never seen a formula like this before so I thought someone might have.

  5. #5
    Forum Contributor
    Join Date
    01-06-2015
    Location
    Huntsville, AL
    MS-Off Ver
    Office 365
    Posts
    185

    Re: Understanding this If Statement formula

    It definitely works. Thanks for the formula. I definitely don't understand how this one works. I might just create a table and do an Index and Match to get the expected result.

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Understanding this If Statement formula

    I might just create a table and do an Index and Match
    You need INDEX and XMATCH with a search last to first otherwise the formula can not handle 15 and 35 correct.

    In formula of Post #3, I have used XLOOKUP what is the same as INDEX and XMATCH. The tables are defined in the formula.

    Here is another formula that does the job:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attachment with all 3 formulas.
    Attached Files Attached Files
    Last edited by HansDouwe; 01-10-2024 at 11:56 AM.

  7. #7
    Forum Contributor
    Join Date
    01-06-2015
    Location
    Huntsville, AL
    MS-Off Ver
    Office 365
    Posts
    185

    Re: Understanding this If Statement formula

    Thank you HansDouwe. I appreciate you going above and beyond to help.

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Understanding this If Statement formula

    You are Welcome

    Thanks for the feedback and rep . Glad to have helped!

    If there any questions left, don't hesistate to ask these questions here.

+ 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] Need help understanding this "IF" Statement Formula
    By Chris McGlothen in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-14-2020, 11:35 AM
  2. understanding a formula
    By swfarm in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-08-2019, 01:56 PM
  3. Understanding a formula
    By Tlarkin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-16-2018, 04:37 PM
  4. If Statement in Access - Need Help Understanding
    By henrock24 in forum Access Tables & Databases
    Replies: 1
    Last Post: 04-17-2015, 03:30 PM
  5. [SOLVED] Understanding logical_test entry in IF statement
    By AndyL446 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-11-2013, 10:30 PM
  6. Help understanding Variables in an IF/VLOOKUP statement
    By FurRelKT in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2006, 11:50 AM
  7. Understanding macro statement
    By HWMI in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2006, 03:15 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