+ Reply to Thread
Results 1 to 24 of 24

Help with formula: multiple IF functions

  1. #1
    Registered User
    Join Date
    10-22-2019
    Location
    Manchester England
    MS-Off Ver
    365
    Posts
    10

    Help with formula: multiple IF functions

    Hi

    I am quite a novice at Excel formulas. Currently pulling my hair out. Could you help me with the following formula:

    If L2 >= B2+10, then the value is L2, but IF L2 >B2+6 and L2<B2+10 then the value is L3, and IF L2< B2+6 then the value is L2+1.3

    I've read help files, but the nesting is messing things up.

    Please help.

    Raz_M

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

    Re: Help with formula: multiple IF functions

    Welcome to the forum.

    Know that you cannot have both data entry AND a formula in the same cell - that is not possible.

    Will you please attach a small sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    Instructions (Please Read Carefully):

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment (it hasn't worked for years, and despite our repeatedly asking the technical team who own the forum to fix it, they can't be bothered to do so), so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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 Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Help with formula: multiple IF functions

    Hello and welcome to the forum.

    Try this:

    =IF(L2>=B2+10,L2,IF(AND(L2<B2+10,L2>=B2+6),L3,IF(L2<B2+6,L2+1.3)))

    It can be shortened further but this layout is for your ease of understanding.

    Shorter version:
    =IF(L2>=B2+10,L2,IF(L2>=B2+6,L3,L2+1.3))
    Last edited by 63falcondude; 10-22-2019 at 10:10 AM.

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Help with formula: multiple IF functions

    Try:
    =IF(L2 >= B2+10,L2,IF(AND(L2 >B2+6, L2<B2+10),L3,IF(L2< B2+6,L2+1.3,"No condition yet")))
    Click the * to say thanks.

  5. #5
    Registered User
    Join Date
    10-22-2019
    Location
    Manchester England
    MS-Off Ver
    365
    Posts
    10

    Re: Help with formula: multiple IF functions

    Thank you!

  6. #6
    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,719

    Re: Help with formula: multiple IF functions

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  7. #7
    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,719

    Re: Help with formula: multiple IF functions

    If you have further queries on this, you need to continue here. I have closed the duplicate thread.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Help with formula: multiple IF functions

    In answer to the Q posed on your duplicate (and now closed) thread:

    =IF(ABS(B2-L2)<6,L2-1.3,IF(ABS(B2-L2)<10,10*LOG((10^(L2/10))-(10^(B2/10))),L2))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  9. #9
    Registered User
    Join Date
    10-22-2019
    Location
    Manchester England
    MS-Off Ver
    365
    Posts
    10

    Re: Help with formula: multiple IF functions

    Hi

    I posted here on Tuesday, but have been away. Only just had a chance to have a go with this, and I'm still struggling.

    The purpose of the calc is for a calculation sheet which simply compares values:

    * If the difference between L2 and B2 is >=10, then the value is L2.
    * If the difference between L2 and B2 is >=6 AND <10, then the value is the logarithmic equation
    * If the difference between L2 and B2 is <6, then there is a simple subtraction of 1.3 from L2

    Here's the formula I am using: =IF(L2-B2>=10,L2,IF(L2-B2<6,L2-1.3,IF(AND(L2-B2>6,L2-B2<10),10*LOG((10^(L2/10))-(10^(B2/10))))))

    When I use real data, the above corrections do not seem to work. So, I am sure I have done something fundamentally wrong. I'm just not experienced enough to figure it out. Can any of you experts help?

    Many thanks, for what must seem ultra-trivial.

    Raz

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Help with formula: multiple IF functions

    My answer is given in Post 8 of this thread. I'm faster than light, you know!!

    If incorrect, then post a sample sheet with manually calculated answer examples.

  11. #11
    Registered User
    Join Date
    10-22-2019
    Location
    Manchester England
    MS-Off Ver
    365
    Posts
    10

    Re: Help with formula: multiple IF functions

    Hi,

    Thanks. I'm using this now: IF(ABS(L2-B2)<6,L2-1.3,IF(ABS(L2-B2)<10,10*LOG((10^(L2/10))-(10^(B2/10))),L2)) Apologies about the confusion of the L2 and B2 order! This works, except for when L2-B2 is equal to '10'. So for L2 =100 and B2 =90, the formula spits out 99.5 instead of 100. Any idea?

    Thanks again.

  12. #12
    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,719

    Re: Help with formula: multiple IF functions

    Maybe this:

    =ROUND(IF(ABS(L2-B2)<6,L2-1.3,IF(ABS(L2-B2)<10,10*LOG((10^(L2/10))-(10^(B2/10))),L2)),0)

  13. #13
    Registered User
    Join Date
    10-22-2019
    Location
    Manchester England
    MS-Off Ver
    365
    Posts
    10

    Re: Help with formula: multiple IF functions

    Hi

    Thanks, no that doesn't seem to solve it. Also, I need to work to 2 decimal places.

  14. #14
    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,719

    Re: Help with formula: multiple IF functions

    Please attach a sample workbook - we've reached the limit of working in the dark. We need to see this in context. See the yellow banner up top or post #2 for instructions.
    Last edited by AliGW; 10-27-2019 at 05:55 AM.

  15. #15
    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,719

    Re: Help with formula: multiple IF functions

    Waiting for the workbook ... Hope you are putting one together for us.

  16. #16
    Registered User
    Join Date
    10-22-2019
    Location
    Manchester England
    MS-Off Ver
    365
    Posts
    10

    Re: Help with formula: multiple IF functions

    Hi

    Excel sheet attached. The sheet averages lots of data for L2 and B2 and then applies the calc. As seen in Case 1, a difference of 10 returns 99.5 instead of 100.

    Thanks again, Raz
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    12-03-2012
    Location
    CHENNAI , INDIA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Help with formula: multiple IF functions

    Hi ,

    This may or may not be relevant , but in the formulae that you use , you have :

    1. =COUNT(D2,D4,D5,D6,D7,D8,D9,D10,D11,D12,D13,D15,D16,D17,D18,D19,D20,D21,D22,D23,D24,D25,D16)

    2. =COUNTA(E2,E4,E5,E6,E7,E8,E9,E10,E11,E12,E13,E15,E16,E17,E18,E19,E20,E21,E22,E23,E24,E25,E16)

    3. =COUNT(D31,D33,D34,D35,D36,D37,D38,D39,D40,D41,D42,D44,D45,D46,D47,D48,D49,D50,D51,D52,D53,D54,D45)

    4. =COUNTA(E31,E33,E34,E35,E36,E37,E38,E39,E40,E41,E42,E44,E45,E46,E47,E48,E49,E50,E51,E52,E53,E54,E45)

    In all the cases in the denominator , two cell values have been omitted , while one cell value has been repeated.

    Is this intentional ? At present , this will not matter , but as and when those omitted / repeated cells have data , it can make a difference.

    Narayan

  18. #18
    Registered User
    Join Date
    10-22-2019
    Location
    Manchester England
    MS-Off Ver
    365
    Posts
    10

    Re: Help with formula: multiple IF functions

    Hi

    May have changed when I deleted several other rows to make this a sheet i can share. But thank you for pointing this out to me, very appreciated.

  19. #19
    Registered User
    Join Date
    12-03-2012
    Location
    CHENNAI , INDIA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Help with formula: multiple IF functions

    Hi ,

    Can you not use the shorter versions which use the colon , as in :

    =COUNT(D2:D26)

    Since D14 does not contain any data , including it will not make any difference.

    The shorter version is easier to read and understand.

    Narayan

  20. #20
    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,719

    Re: Help with formula: multiple IF functions

    From D29:

    =IF(ABS(D28-D57)<=6,D28-1.3,IF(ABS(D28-D57)<10,10*LOG((10^(D28/10))-(10^(D57/10))),D28))

    Explain the ranges you have used - these make no sense to me in the context.

  21. #21
    Registered User
    Join Date
    10-22-2019
    Location
    Manchester England
    MS-Off Ver
    365
    Posts
    10

    Re: Help with formula: multiple IF functions

    Hi

    Many thanks for your help to date. The ranges apply a correction to measured noise data (L2), depending on how noisy background levels are (B2).

  22. #22
    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,719

    Re: Help with formula: multiple IF functions

    That's what they are meant to do, but have you actually CHECKED that those ranges are correct? They certainly don't appear to be based on your sample file. For instance: D28-D57????

  23. #23
    Registered User
    Join Date
    10-22-2019
    Location
    Manchester England
    MS-Off Ver
    365
    Posts
    10

    Re: Help with formula: multiple IF functions

    Hi Thanks for your help with this. I will try to resolve this formula offline. I had (wrongly) assumed there was a simple way that excel could test three different conditions and apply a result based on the outcome of each test.

    Thanks again.

  24. #24
    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,719

    Re: Help with formula: multiple IF functions

    I did not say that what you want to do cannot be done - how did you get that from what I posted???

    We would like to help you to solve this - you just need to answer questions carefully and give any other details requested.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as 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] Formula using multiple IF/AND/OR functions
    By HDL16 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-03-2018, 06:48 PM
  2. [SOLVED] Multiple IF Functions with LOOKUP formula
    By alexpope in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-22-2015, 08:55 PM
  3. Multiple Functions in Formula
    By robstark in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-29-2015, 05:30 PM
  4. [SOLVED] Need help with formula to execute multiple functions
    By kosherboy in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-17-2013, 01:08 AM
  5. Multiple functions in one formula
    By Dannibm in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-10-2011, 06:18 PM
  6. multiple functions in one formula
    By ErikVegas in forum Excel General
    Replies: 6
    Last Post: 05-12-2010, 12:59 PM
  7. Question re multiple functions in a formula...
    By doublejoy529 in forum Excel General
    Replies: 3
    Last Post: 08-02-2008, 02:39 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