+ Reply to Thread
Results 1 to 15 of 15

combining IF and AND

  1. #1
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    combining IF and AND

    another simple one from me, folks. =( I have the table below. need assist with the last col. obviously this is financial data. last col needs to be cash that's avail to be taken out. tried using IF and AND, per title, but my formula workings is horrid. here's what i'm looking for:
    • if purch avail < cash limit, cash avail = purch avail
    • if cash limit = 0, cash avail = "n/a"
    • if cash limit - cash bal < purch avail, cash avail = cash limit - cash bal
    • if cash limit - cash bal > purch avail, cash avail = purch avail

    I don't think i left anything out. you guys can probably tell what i'm doing at this point. didn't know how to put it into words. didn't want to write an essay. thanks.
    Attached Images Attached Images

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,633

    Re: combining IF and AND

    Administrative note

    Welcome to the forum

    in your haste to solve your problem, you probably missed the yellow banner advising how to get answers faster by posting a sheet ?

    Please take a moment to read it and attach a sheet accordingly.

    Thanks you for helping us help you

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,234

    Re: combining IF and AND

    The way to do this, Adam (because I know you don't just want to be handed a solution), is to create an IF statement for each of your conditions, then bring them together in one nested statement.

    IF with AND gos something like this:

    =IF(AND(x=y,y>z),...
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: combining IF and AND

    Whilst not wanting to disagree with Ali, I think you have the option of ifs if you use 365. 2016 - 365 / 2007 is not so clear in a profile, otherwise nested ifs

    if (purch avail < cash limit, purch avail,if(cash limit = 0, "n/a", etc etc))


    or

    ifs (purch avail < cash limit, purch avail,if(cash limit = 0, "n/a", etc etc)

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,659

    Re: combining IF and AND

    May be:

    =IF(G14=0,"n/a",IF(G14>H14,H14,MIN(G14-E14,H14)))

    With G14=CASH LIM
    H14=PUSH AVAIL
    E14=CASH BAL
    Last edited by bebo021999; 12-29-2020 at 04:34 AM.
    Quang PT

  6. #6
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: combining IF and AND

    thanks guys. Bebo, yours works fine, but does not for one line. did I leave out a conditional I wonder? I plugged the relative into all the cells, and only one
    row was incorrect. this ask of mine is not working in the image below (item 1):
    Please Login or Register  to view this content.
    item 1's col should be 202, not 1958. all other rows work, but did not test all variations. see attached book for data i work with. and Pepe, I don't
    need fast responses. whenever people can see my thread, that's fine by me.
    Attached Images Attached Images
    Attached Files Attached Files

  7. #7
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: combining IF and AND

    I didn't try the rest of your stuff guys, sorry. Ali, actually in this case I do want to be handed something. I do a lot of coding during the day and the last thing I want to do is learn something else I'm not good at. in this cases, math formulas. I'd rather just code the thing. =( but that's becoming extremely unpopular, for many reasons ya know? people are just not intelligent anymore. there's no thinking needed. just drag and drop. push the button and out pops the encrypted hash. but I figured I was doing the AND part wrong. I was trying to use is as an operator, not a nested function.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,234

    Re: combining IF and AND

    Why should it be 202? Explain.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,234

    Re: combining IF and AND

    people are just not intelligent anymore.
    Please remember that you have been asked to avoid making comments like this by the admin team. It's completely irrelevant to your query.

    but I figured I was doing the AND part wrong. I was trying to use is as an operator, not a nested function.
    I showed you how it works as an operator, but it will have to become part of a nested function if you use it to solve this issue, as per your thread title:

    combining IF and AND
    Ali, actually in this case I do want to be handed something.
    Can you see the irony here???
    Last edited by AliGW; 12-29-2020 at 05:28 AM.

  10. #10
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: combining IF and AND

    The question is why? cadsh adv bal is negative

    =IF(L2=0,"N/A",IF(L2>M2,M2,MIN(J2+L2,M2))) perhaps


    the cash adv balance is negative you also have changed the column headings to different terms to your original post with the logic

  11. #11
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014
    Quote Originally Posted by AliGW View Post
    Please remember that you have been asked to avoid making comments like this by the admin team. It's completely irrelevant to your query.
    oh yes I realize I've been worn. And that's exactly why I don't have a future in this business. There's no place for somebody like me in this environment anymore :-(. Obviously.

    but hopefully you guys and everybody else around here don't think that these comments are targeted to the question askers around here because they aren't it relates to the world completely.

    But back on topic, no I don't see the irony But to answer your question about why 202 is the answer, the reasoning should be in the table headers aren't they?

  12. #12
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: combining IF and AND

    As you can see Ali the current amount of cash that is taken out on that record is 878. And the advanced limit is obviously 1080. That's why the answer is 202. you obviously can't take out more cash on a financial credit line than the cash limit right?

  13. #13
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014
    Quote Originally Posted by davsth View Post
    The question is why? cadsh adv bal is negative

    =IF(L2=0,"N/A",IF(L2>M2,M2,MIN(J2+L2,M2))) perhaps
    the fact that some of the numbers are negative has nothing to do with anything. That's just the way I remember what money goes out and what money comes in.Negative and positive should make absolutely no difference here it's just a change in mathematical operators to get to the right answer and I figured you guys were smart enough around here to write it either way. but if you want me to change the negatives to positives I can certainly do that in order to get my answer in terms of the formulas I need from you guys if you're willing to give that thanks

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,234

    Re: combining IF and AND


    As you can see Ali the current amount of cash that is taken out on that record is 878. And the advanced limit is obviously 1080. That's why the answer is 202. you obviously can't take out more cash on a financial credit line than the cash limit right?
    Obviously!

    Thanks for clarifying. Seems you already have your answer. Please mark the thread as solved, if so.
    Last edited by AliGW; 12-29-2020 at 09:21 AM.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,234

    Re: combining IF and AND

    I figured you guys were smart enough around here to write it either way
    We are all very smart - it goes without saying.

    You should be able to use ABS(your_sum) to have it return a positive result regardless. I'll leave you to try it, because I think you should learn these things (just as you think other members here should learn). OK?

+ 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] Combining vertical cells into one and between blank rows start combining again?
    By mike_m1 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-21-2012, 12:19 PM
  2. Combining
    By coffeecup in forum Excel General
    Replies: 5
    Last Post: 12-16-2011, 12:33 PM
  3. Help on IF/OR (combining IFs)
    By Immortalis15 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-24-2011, 05:30 PM
  4. Combining IF with MAX
    By babydee0413 in forum Excel General
    Replies: 1
    Last Post: 02-19-2010, 06:16 PM
  5. Combining IF, AND, OR
    By ChrisMattock in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-07-2009, 12:34 PM
  6. Combining IF,AND with OR possible?
    By gmcana in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-14-2008, 09:11 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