+ Reply to Thread
Results 1 to 10 of 10

Excel 2007 : Multiple IF statements in one cell

Hybrid View

StephenNesbit Multiple IF statements in one... 06-06-2012, 03:52 PM
amotto11 Re: Multiple IF statements in... 06-06-2012, 03:56 PM
alansidman Re: Multiple IF statements in... 06-06-2012, 04:04 PM
mmogharreban Re: Multiple IF statements in... 06-06-2012, 04:04 PM
StephenNesbit Re: Multiple IF statements in... 06-06-2012, 04:09 PM
mmogharreban Re: Multiple IF statements in... 06-06-2012, 04:25 PM
StephenNesbit Re: Multiple IF statements in... 06-06-2012, 04:33 PM
amotto11 Re: Multiple IF statements in... 06-06-2012, 04:25 PM
mmogharreban Re: Multiple IF statements in... 06-06-2012, 04:42 PM
StephenNesbit Re: Multiple IF statements in... 06-06-2012, 04:52 PM
  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    Baton Rouge, LA, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Question Multiple IF statements in one cell

    Okay, I need to do an apartment building calculation spreadsheet.

    The demand factor percentage changes depending on how many dwelling units are in the building. In cell A1, one would input how many dwelling units. Cell B1 would display the demand factor. The information is below. I'm stuck as to how to actually get all this information in one freaking cell.

    NUMBER OF
    DWELLING	 DEMAND
    UNITS		 FACTOR (%)
    
    IF   (3-5), THEN (45)
    IF   (6-7), THEN (44)
    IF  (8-10), THEN (43)
    IF    (11), THEN (42)
    IF (12-13), THEN (41)
    IF (14-15), THEN (40)
    IF (16-17), THEN (39)
    IF (18-20), THEN (38)
    IF    (21), THEN (37)
    IF (22-23), THEN (36)
    IF (24-25), THEN (35)
    IF (26-27), THEN (34)
    IF (28-30), THEN (33)
    IF    (31), THEN (32)
    IF (32-33), THEN (31)
    IF (34-36), THEN (30)
    IF (37-38), THEN (29)
    IF (39-42), THEN (28)
    IF (43-45), THEN (27)
    IF (46-50), THEN (26)
    IF (51-55), THEN (25)
    IF (56-61), THEN (24)
    IF  (62 >), THEN (23)

  2. #2
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Multiple IF statements in one cell

    stephen,

    If you are trying to do this just in the workbook, you could always create a list and then do a vlookup to get the value, this would save you a lot of time. You would not even have to write a single if statement.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,706

    Re: Multiple IF statements in one cell

    I would do this by building a table of units and demand.
    Then in cell B1, I would use the vlookup function to retrieve the values in the table for the number of units in cell A1

    Look here for a tutorial on Vlookup

    www.techonthenet.com

    edit: Amotto types faster than me.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    05-22-2012
    Location
    IL
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Multiple IF statements in one cell

    Hi Stephen

    You can nest up to 64 IF statements in one cell where =IF(A1>=62,.23,IF(A1>=56,.24,IF(A1>=51,.25...and so on. Using VLOOKUP would be much easier than nesting 23 IF statements though.

  5. #5
    Registered User
    Join Date
    06-06-2012
    Location
    Baton Rouge, LA, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Multiple IF statements in one cell

    Thanks for the quick answers! Having the data on a separate tab does seem a lot easier, but the VLookup command seems complicated as all get out.

  6. #6
    Registered User
    Join Date
    05-22-2012
    Location
    IL
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Multiple IF statements in one cell

    Here's an example. Put your data on a seperate sheet and reference just the same.


    Book2.xlsx

  7. #7
    Registered User
    Join Date
    06-06-2012
    Location
    Baton Rouge, LA, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Multiple IF statements in one cell

    Apt Load Calc (Bldg).xlsx

    Here you go amotto11.

  8. #8
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Multiple IF statements in one cell

    stephen just post your sheet and i will finish it for you

  9. #9
    Registered User
    Join Date
    05-22-2012
    Location
    IL
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Multiple IF statements in one cell


  10. #10
    Registered User
    Join Date
    06-06-2012
    Location
    Baton Rouge, LA, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Multiple IF statements in one cell

    I tweaked it a bit, but got it to work as intended.

    Thanks, mmogharreban!!

+ 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