+ Reply to Thread
Results 1 to 12 of 12

Conditional Output.

  1. #1
    Registered User
    Join Date
    10-26-2010
    Location
    sydney
    MS-Off Ver
    Excel 2007
    Posts
    7

    Conditional Output.

    Hey all, first post here and new to excel...
    I am in the process of making a spreadsheet to calculate an output script for autocad to draw staircases.

    I just need a little help with the correct formula to use in relation to displaying data from 1-25 cells into a main output cell based on whether a corresponding box has the same data as another (constant)corresponding box.? If that makes sense.?

    Here is the formula I am using for the output cell but I am not sure how to put it together to work.

    =IF(H33=I33,J33," ") IF(H34=I34,J34," ") IF(H35=I35,J35," ")

    I am sure i should have an 'and' or an 'or' for false but i'm at a bit of a loss in the logic department.

    I have 25 of these ifs to string together.

    Any help would be greatly appreciated.
    Last edited by Cadman675; 11-01-2010 at 04:31 AM.

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: NewB needs help with multiple if's

    what happens if h33 = i33 and h34 = i34?
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Registered User
    Join Date
    10-26-2010
    Location
    sydney
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: NewB needs help with multiple if's

    H33 is already an if formula,
    =IF(I33=E14,1," ")

    E14 is my main input box.
    So if h33 does = i33(constant) then the true output of the cell should be j33.

  4. #4
    Registered User
    Join Date
    10-26-2010
    Location
    sydney
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: NewB needs help with multiple if's

    I think i may have done an extra calculation i do not need.

  5. #5
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Conditional Output.

    perhaps you could upload an example showing what you have and what you'd like to see?

  6. #6
    Registered User
    Join Date
    10-26-2010
    Location
    sydney
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Conditional Output.

    Here is a basic example of what i want to create.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Conditional Output.

    Try this:
    ="draw 1 tread" & LOOKUP(A1,{0,1,2,3,4},{""," then copy once"," then copy twice"," then copy three times"," then copy four times"})
    Where you change A1 to point to the cell where you type in the number of treads.

    This feels more efficient, but isn't really, and indeed is harder to edit:
    ="draw 1 tread" & LOOKUP(A1,{0,1},{""," then copy "}) & LOOKUP(A1,{0,1,2,3,4},{"","once","twice","three times","four times"})

    You know it's possible to upload Excel spreadsheet files, it makes it a bit easier to give the most useful formula.
    Last edited by Cheeky Charlie; 10-27-2010 at 06:03 AM.

  8. #8
    Registered User
    Join Date
    10-26-2010
    Location
    sydney
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Conditional Output.

    That looks like a good solution however i will need to change a lot of my code and my script at 25 treads is 1360 characters in length.

    Here is the spreadsheet to make it a bit clearer of what i already have to work with.

    btw h33:h57 is there so i can double check that my output is correct quickly...


    Edit; You will need to go to the second sheet.
    Attached Files Attached Files
    Last edited by Cadman675; 10-28-2010 at 03:24 AM. Reason: more info

  9. #9
    Registered User
    Join Date
    10-26-2010
    Location
    sydney
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Conditional Output.

    =IF(H33=I33,J33,IF(H34=I34,J34,IF(H35=I35,J35," ")))etc...

    Thanks Cheeky but I found another similar thread.. This works well for me..

  10. #10
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Conditional Output.

    Not sure exaclty where I'm looking, but for this many options, you can use VLOOKUP(), or INDEX() and write your list of results out.

    Something like:
    U2=once
    U3=twice
    U4=three
    ...

    V1= draw one tread
    V2="draw one tread then copy "&U2
    (copy down one row)
    V4="draw one tread then copy "&U4&" times"
    (copy down to twenty-five)

    then
    O6=INDEX(V:V,E14)

    Your formula in H33:H57 - if you put in:
    =IF(I33=E$14,I33,"")
    you can copy it down the length of the column without having to rewrite it for every cell

    I would (strongly) advise against merging cells.

    hth

  11. #11
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Conditional Output.

    Quote Originally Posted by Cadman675 View Post
    =IF(H33=I33,J33,IF(H34=I34,J34,IF(H35=I35,J35," ")))etc...

    Thanks Cheeky but I found another similar thread.. This works well for me..
    Is a horrible approach.

  12. #12
    Registered User
    Join Date
    10-26-2010
    Location
    sydney
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Conditional Output.

    My whole spreadsheet is a horrible approach now that i realize what the $ does.

    I have redrawn it now and it's a lot simpler.

    I am up to the same point with working out the final output.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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