+ Reply to Thread
Results 1 to 11 of 11

Need help to remove FALSE and shorten the formula

  1. #1
    Registered User
    Join Date
    02-27-2021
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    4

    Need help to remove FALSE and shorten the formula

    Hi guys!

    I need some help to fix the "FALSE" result returned by the formula I have input. I have used the "IF" and "VLOOKUP" functions in this formula.

    =IF(AND(B7="Supplies Cost",C7="Specialist Outpatient Clinic"),VLOOKUP(D7,'Supplies Cost'!$B$2:$C$4,2,FALSE),IF(AND(B7="Supplies Cost",C7="Inpatient Ward"),VLOOKUP(D7,'Supplies Cost'!$B$6:$C$8,2,FALSE),IF(AND(B7="Supplies Cost",C7="Operating Theatre"),VLOOKUP(D7,'Supplies Cost'!$B$10:$C$11,2,FALSE),IF(AND(B7="Supplies Cost",C7="Endoscopy Room"),VLOOKUP(D7,'Supplies Cost'!$B$13:$C$14,2,FALSE),IF(AND(B7="Facility Cost",C7="Specialist Outpatient Clinic"),VLOOKUP(D7,'Facility Cost'!$B$2:$C$4,2,FALSE),IF(AND(B7="Facility Cost",C7="Inpatient Ward"),VLOOKUP(D7,'Facility Cost'!$B$6:$C$8,2,FALSE),IF(AND(B7="Facility Cost",C7="Operating Theatre"),VLOOKUP(D7,'Facility Cost'!$B$10:$C$11,2,FALSE),IF(AND(B7="Facility Cost",C7="Endoscopy Room"),VLOOKUP(D7,'Facility Cost'!$B$13:$C$14,2,FALSE),IF(AND(B7="Other Cost",C7="Specialist Outpatient Clinic"),VLOOKUP(D7,'Other Cost'!$B$2:$C$4,2,FALSE),IF(AND(B7="Other Cost",C7="Inpatient Ward"),VLOOKUP(D7,'Other Cost'!$B$6:$C$8,2,FALSE),IF(AND(B7="Other Cost",C7="Operating Theatre"),VLOOKUP(D7,'Other Cost'!$B$10:$B$11,2,FALSE),IF(AND(B7="Other Cost",C7="Endoscopy Room"),VLOOKUP(D7,'Other Cost'!$B$13:$C$14,2,FALSE)))))))))))))

    The formula can be found in Column K under Prototype worksheet. (:

    May I know if any expert is able to guide me to shorten my formula, but return the same expected result? And also, how to remove the "FALSE" result?

    Thank you!
    Attached Files Attached Files
    Last edited by Bingcheng91; 02-27-2021 at 07:17 AM.

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

    Re: Need help to remove FALSE and shorten the formula

    Welcome to the forum.

    We are good, but not clairvoyant!

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Need help to remove FALSE and shorten the formula

    Please provide a sample file.

    See "HOW TO ATTACH YOUR SAMPLE WORKBOOK" at top of page.

  4. #4
    Registered User
    Join Date
    02-27-2021
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    4

    Re: Need help to remove FALSE and shorten the formula

    Thanks AliGW and JohnTopley. I have attached a sample workbook.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Need help to remove FALSE and shorten the formula

    I suggest you have a SINGLE Cost table showing Supplies in Column C, Facility in Column D and other in Column E

    You could then use INDEX/MAtch lookups to determine the relevant cost

    in K6

    =IFERROR(INDEX(Costs!$C$2:$E$14,MATCH(Prototype!$C6,Costs!$A$2:$A$14,0),MATCH($B6,Costs!$C$1:$E$1,0)),"")

    See "Costs" in attached
    Attached Files Attached Files
    Last edited by JohnTopley; 02-27-2021 at 07:47 AM.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Need help to remove FALSE and shorten the formula

    Use the same approach for Manpower Costs AND avoid using merged cells when formula are required.

  7. #7
    Registered User
    Join Date
    02-27-2021
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    4

    Re: Need help to remove FALSE and shorten the formula

    Thanks JohnTopley!

    May I know how to add another Match function in the same formula? Column K is also dependent on the selection at Column D. Currently the formula tries to match Column B & C, but not Column D.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Need help to remove FALSE and shorten the formula

    Use

    =IFERROR(INDEX(Costs!$C$2:$E$14,MATCH(Prototype!$C6&D6,Costs!$A$2:$A$14&Costs!$B$2:$B$14,0),MATCH($B6,Costs!$C$1:$E$1,0)),"")

    This must be entered with Control+Shif+Enter

    Hold down CTRL and SHIFT kets and press ENTER

    You will see { ....} round the formula
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-27-2021
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    4

    Re: Need help to remove FALSE and shorten the formula

    Thanks JohnTopley for your help! The formula works perfectly!

    May I also take the opportunity to ask some questions?

    How do I create a dependent drop down list to check inputs from 2 cells? The current data validation dialog box has character limit, thus I am unable to enter all the possible arguments. My Column D is dependent on Column C, but I need to break down Manpower Cost from the original “Across All Care Settings” to “Specialist Outpatient Clinic”, “Inpatient Ward”, “Operating Theatre” and “Endoscopy Room”. However, with this change, it will affect the drop-down list in Column D, causing it unable to show the list of Activity under "Type of Activity" worksheet. I have kind of summarised the expected result for Column C and Column D.

    Image 1.PNGImage 2.PNG
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Need help to remove FALSE and shorten the formula

    See the attached.

    A new Sheet "Workarea" has the dynamic lists generated for the various combinations of C and D. The "Maintenanc Cost" is simple a copy of the "Tpe of actvity" Sheet"

    In "Workarea"

    B2

    =IFERROR(INDEX(Costs!$B$1:$B$14,SMALL(IF((Costs!$A$1:$A$14=Workarea!$G$2)*(INDEX(Costs!$C$1:$E$14,0,MATCH(Workarea!$B$1,Costs!$C$1:$E$1,0))<>"Not Applicable"),ROW($1:$14),""),ROWS($1:1))),"")

    Enter with CTRL+SHIFT+ENTER

    Similar in C & D

    In G2: this has the value selected in column D of "Prototype"

    In "Prototype" a small VBA reoutine;

    Please Login or Register  to view this content.
    To see/add code click on "Developer" then "Visual Basic". Click Sheet1 ("Prototype") and code will be on right-hand side window

    When data is entered in "Prototype", the data in "Workarea" will change under the appropriate cost heading

    NOTE: this now an XLSM (macro workbook)
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Need help to remove FALSE and shorten the formula

    To avoid repeating the "Type Of Activity" data under "Manpower Costs" in the "Workarea" sheet, I set "Manpower Cost" named range to that in "Type of Activity".

    I'll leave you to do the change in the workbook I sent.

+ 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] Amend formula to remove ‘FALSE’ if no valid data to display
    By robertguy in forum Excel General
    Replies: 2
    Last Post: 04-19-2018, 10:30 AM
  2. [SOLVED] Need to remove FALSE return
    By gz3s36 in forum Excel General
    Replies: 3
    Last Post: 12-11-2017, 01:59 AM
  3. Need help to remove FALSE as a result
    By HawaiianD in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-10-2016, 08:46 AM
  4. How to Remove False from output
    By cndu in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-01-2015, 02:31 AM
  5. [SOLVED] How do i remove "false" from an IF/AND formula
    By moe1986 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-18-2015, 08:06 AM
  6. Remove FALSE from array formula
    By strangedenial in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-29-2015, 03:15 AM
  7. [SOLVED] Remove "FALSE" error message from this formula please?
    By CatSqueezer in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-10-2013, 03:39 PM

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