+ Reply to Thread
Results 1 to 8 of 8

IF AND Formula HELP

  1. #1
    Registered User
    Join Date
    01-14-2019
    Location
    Scotland
    MS-Off Ver
    Office365
    Posts
    3

    IF AND Formula HELP

    Hi All!

    I am trying to create something totally out with my capabilities so hope you can help...…

    I have created a table from which I have created a list, when I choose these items from a list I want them to add different data to different cells...

    For Example...

    =IF(A6="PL202 Type W","0.5","0") but I want "0.5" to be multiplied by B6 which is a number AND only IF B6 >0 (this is the easy part hopefully)

    I also want

    =IF(A6="PL202 Type W","14","0") but I also want different permutations too such as =IF(A6="PL202 Type X","6","0") but I want them to all add together in one cell as there may be 20 different options from 20 different cells.

    Really hope you can help.

    Thanks in advance
    Attached Files Attached Files
    Last edited by kevjkeenan; 01-14-2019 at 11:41 AM. Reason: Title Change

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,822

    Re: Far too complicated

    First of all, I think you should change your title, as it doesn't conform to the Forum Rules - see Forum Rules at the top of the screen.

    Secondly, it would help if you attached a sample Excel workbook.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post. Do NOT try to use the Paperclip icon, as it doesn't work on this forum.

    In your sample file you can perhaps explain more clearly what you want to achieve, perhaps with a BEFORE and AFTER sheet.

    Hope this helps.

    Pete

  3. #3
    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,504

    Re: IF AND Formula HELP

    this takes care of your first condition... =IF(AND(A6="PL202 Type W",B6>0),B6*0.5,0)
    the problem I see is that your second condition IF(A6="PL202 Type W","14","0") is the same condition as the first one except you want the output as 14 instead.
    AND, BTW, remove the quotes from around the numbers "14" and "0" because these are changing the numbers to text so down stream from there you cannot add them or do other math on them without changing them back.

    AND too, Pete asked you to put in your sample before and after and I would add, expected outcomes. You state you want them all to add together and possibly 20 different options and 20 different cells, we're not mind readers so we don't know exactly what you are adding and what your inputs and expected outcomes should be so you need to add more information.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Registered User
    Join Date
    01-14-2019
    Location
    Scotland
    MS-Off Ver
    Office365
    Posts
    3

    Re: IF AND Formula HELP

    Hi Sam, Thank you very much for this. I am very new to forums so really unsure of the rules and to be honest what I am asking.

    In my head I want to add many IF's to the one cell e.g =IF(AND(A6="PL202 Type W",B6>0),B6*0.5,0) or =IF(AND(A6="PL202 Type X",B6>0),B6*0.5,0) or =IF(AND(A6="THAL",B6>0),B6*0.5,0)

    so background to it all....I supply the events industry with toilets and offices and a PL202 Type W (20ft shell) is 0.5 of a load (40ft articulated wagon) so when I choose the type W from the dropdown menu on the product and type in how many I want e.g 2 I want this to auto calculate the loads e.g 2 x 20ft is 1 load of a 40ft articulated wagon.

    a type w is a toilet that has 7 cubicles, each cubicle takes 2 toilet rolls (TP) calculated at the bottom of the sheet which I can also use the above formula for this?? =IF(AND(A6:A20="PL202 Type W",B6>0),B6*14,0) as A6 to A20 are the product lines but this formula doesn't work.

    how exactly do I type it in?

    I have included an up to date spreadsheet with the formula in and there is a table to the right of the spreadsheet that states the product and what goes with it.

    Equivalents at the top is also auto calculated, I have typed in same formula to Loo equivalent for 202 but it doesn't work
    Attached Files Attached Files

  5. #5
    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,504

    Re: IF AND Formula HELP

    We have the forum rules posted under that link at the top of this post. You are not (to my knowledge) in violation of any rules so far. We just try to give you advice that will help you get the best answer possible and hopefully you'll learn some excel along the way.

    Now, as for this... =IF(AND(A6="PL202 Type W",B6>0),B6*0.5,0) or =IF(AND(A6="PL202 Type X",B6>0),B6*0.5,0) or =IF(AND(A6="THAL",B6>0),B6*0.5,0) usually the way to handle a series of if then statements is to make the next if follow on the last one so it would look like this...
    =IF(AND(A6="PL202 Type W",B6>0),B6*0.5,IF(AND(A6="PL202 Type X",B6>0),B6*0.5,IF(AND(A6="THAL",B6>0),B6*0.5,0)))
    where the last one has the final 0 as the alternative.
    another shorter way to write you have (just with those three if thens) is =IF(AND(OR(A6="PL202 Type W",A6="PL202 Type X",A6="THAL"),B6>0),B6*0.5,0)
    There is also the possibility to use sumproduct or set up a vlookup table or an index/match if you have multiple inputs for A6 but a lot of the same for the outputs.
    So simplifying what you are posting and showing us the extent of what you have and need can help us better help you.
    And welcome to the forum, we'd rather be helpful than annoying about rules.

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

    Re: IF AND Formula HELP

    now getting toward the bottom of your post I see that you have this...
    =IF(AND(A6:A20="PL202 Type W>0),B6:B20*0.5,0)
    the ranges are what will create problems. If you do it one at a time you should be find for an if/then.
    but if you are doing a range you might want to use a different formula like this..
    IF(COUNTIFS(A6:A20,"PL202 Type W",B6:B20,">"&0)>0,SUM(B6:B20)*0.5,0)

  7. #7
    Registered User
    Join Date
    01-14-2019
    Location
    Scotland
    MS-Off Ver
    Office365
    Posts
    3

    Re: IF AND Formula HELP

    Thanks again Sam! Massive help.

    Becomes complicated when I need to add more IFs ………. =IF(AND(OR(A5:A21="PL202 Type W",A5:A21="PL202 Type X",A5:A21="PL202 Type I"),B5:B21>0),B5:B21*0.5,0),IF(AND(OR(A5:A21="THAL",A5:A21="Shorelink"),B5:B21>0),B5:B21*0.0454545,0),IF(AND(OR(A5:A21="DPU",A5:A21="DPU c/w BC",A5:A21="Double Sink Unit"),B5:B21>0),B5:B21*0.15,0)

    That is what im trying to type in the load calculator section but not winning

    Also in the LOO EQUIVALENTS section of my spreadsheet (under 202)ive typed =IF(AND(OR(A5:A21="PL202 Type W",A5:A21="PL202 Type X",A5:A21="PL202 Type I"),B5:B21>0),B5:B21*1,0) seems pretty simple to understand but i'm still getting a 0 value but should be 10?? hmmmmm

    My table at the right hand side shows how much TP (toilet paper) is required for each product
    TP
    PL202 Type W 14
    PL202 Type X 6
    PL202 Type I 10
    THAL 2
    Shorelink 2
    DPU c/w BC 2
    DPU 2
    Double Sink Unit0

    this is what I have typed =IF(COUNTIFS(A6:A20,"PL202 Type W",B6:B20,">"&0)>0,SUM(B6:B20)*14,0)but I need to incorporate if A6:A20 have "Type X" & B6:B20 >0 then multiply that number by 6 and add that too what is there already...therefore cell B77 should have 132 TP based on the table and quantities selected?

    New book should be attached below, hopefully...

    Thanks again in advance!
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,674

    Re: IF AND Formula HELP

    Hello kevjkeenan and Welcome to Excel Forum.
    A somewhat 'low tech' option would be to expand the 'table at the right hand side' to include the number of units then multiply by the number required for each unit of each product. You could then use a straight assignment i.e. B78: = AR13
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] complicated if
    By cotix in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-26-2014, 05:35 AM
  2. [SOLVED] Complicated Look UP
    By Excel Dumbo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-11-2013, 08:46 PM
  3. Help with complicated look up
    By GAVGAV27 in forum Excel General
    Replies: 8
    Last Post: 05-05-2012, 05:30 PM
  4. Complicated If/Then
    By Fcroft in forum Excel General
    Replies: 4
    Last Post: 08-13-2010, 03:06 PM
  5. complicated SUM
    By dz6kb4 in forum Excel General
    Replies: 3
    Last Post: 12-07-2008, 10:38 AM
  6. Need help w/ complicated fx
    By rgood in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-23-2008, 02:43 AM
  7. This is more complicated than it looks.
    By dollarbill79 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-13-2006, 06:35 PM
  8. Something perhaps a little complicated
    By brodiemac in forum Excel General
    Replies: 1
    Last Post: 06-13-2006, 10:15 AM

Tags for this Thread

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