+ Reply to Thread
Results 1 to 19 of 19

need help with IF in excel 2016

  1. #1
    Registered User
    Join Date
    06-11-2017
    Location
    Richburg, SC
    MS-Off Ver
    O365 HOME
    Posts
    8

    Question need help with IF in excel 2016

    ok so I have a spreadsheet which has 3 different names in a drop down list well i want different values based on the name selected while if for the selected name is blank its value is "" but also doesn't interfere with the other names on the list.... here is what i have so far

    =IFS(
    NAME="John Doe",John_GAS_SATURDAY_INITIAL,
    NAME="Jane Doe",Jane_GAS_SATURDAY_INITIAL,
    NAME="Jean Doe",Jean_GAS_SATURDAY_INITIAL)

    ideal results is

    John Doe Gas is empty return ""
    Jane Doe gas is $5.00 return "$5.00"
    Jean Doe gas is $6.00 return "$6.00"

    previous attempts would return "" for the selected name even when giving the value because gas for the 1st name tested was empty...

    any help would be appreciated!

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: need help with IF in excel 2016

    Hi tm, welcome to Excel Forums! Will this work?:
    =CHOOSE(MATCH(NAME,{"John Doe","Jane Doe","Jean Doe"},0),John_GAS_SATURDAY_INITIAL,Jane_GAS_SATURDAY_INITIAL,Jean_GAS_SATURDAY_INITIAL)

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee

  3. #3
    Registered User
    Join Date
    06-11-2017
    Location
    Richburg, SC
    MS-Off Ver
    O365 HOME
    Posts
    8

    Re: need help with IF in excel 2016

    anyway to make it display an empty cell rather than $0.00 when there isn't a value assigned to the names?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: need help with IF in excel 2016

    Maybe this, although I have a feeling your sample if too generic?

    =LEFT(NAME,FIND(" ",NAME)-1)&"_Gas Saturdaty_Initial"

    Not really sure how you want those values included?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: need help with IF in excel 2016

    You could apply this custom Number Format to the cells: 0;0;; The empty section between the 2nd and 3rd semi-colons hides zeros.
    Untitled.png

    To do it in the formula, I need more info.

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 06-11-2017 at 02:07 AM.

  6. #6
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: need help with IF in excel 2016

    Actually, use this custom Number Format if you want to display currency amounts or blanks: $0.00;$0.00;;

  7. #7
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: need help with IF in excel 2016

    ...OR here's a formula that works. NOD to Ford for the more efficient Find method. I put his formula in an INDIRECT function to generate a Defined Name instead of text, then used the returned value as a divisor. Zeros cause an error, which yields "" through the IFERROR clause.

    =IFERROR(1/(1/INDIRECT(LEFT(NAME,FIND(" ",NAME)-1)&"_Gas_Saturday_Initial")),"")

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee

  8. #8
    Registered User
    Join Date
    06-11-2017
    Location
    Richburg, SC
    MS-Off Ver
    O365 HOME
    Posts
    8

    Re: need help with IF in excel 2016

    the last formula didn't work so here is a link to my Excel file so that you can see what I'm working with

    https://www.dropbox.com/s/vhhghgoae6...heet.xlsm?dl=0

    the file does have macros so if you see a warning it's just a macro to create a folder with the next Saturday's date then save as pdf

  9. #9
    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,779

    Re: need help with IF in excel 2016

    Will you please attach a sample Excel workbook? Many members will not or cannot access file-sharing sites.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please disable the macro before uploading the 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.

  10. #10
    Registered User
    Join Date
    06-11-2017
    Location
    Richburg, SC
    MS-Off Ver
    O365 HOME
    Posts
    8
    here it is!
    Attached Files Attached Files

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: need help with IF in excel 2016

    1st, you have a circ ref error in sheet WED W1 G8 that you need to fix

    2nd, where do you want the formula, and what do you expect?

  12. #12
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: need help with IF in excel 2016

    Quote Originally Posted by techmaster29729 View Post
    the last formula didn't work so here is a link to my Excel file so that you can see what I'm working with
    Perhaps it didn't work because you hadn't defined the name Jean_Gas_Saturday_Initial! When I did that and applied the formula with Name = "Jean Doe", it worked fine.

    ps. Ford, I think the formula goes in SAT!$H$29

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 06-12-2017 at 06:17 AM.

  13. #13
    Registered User
    Join Date
    06-11-2017
    Location
    Richburg, SC
    MS-Off Ver
    O365 HOME
    Posts
    8
    Quote Originally Posted by leelnich View Post
    Perhaps it didn't work because you hadn't defined the name Jean_Gas_Saturday_Initial! When I did that and applied the formula with Name = "Jean Doe", it worked fine.

    ps. Ford, I think the formula goes in SAT!$H$29

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    well those names where generic names and the defined names was for the real names... srry forgot to change the defined names.. b10 for each name tab goes in h29 Saturday depending on the name selected

  14. #14
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: need help with IF in excel 2016

    We ALL miss details like that at one point or another, it's half the reason why this forum exists! So, is your problem solved? Does the formula work with your actual data?

  15. #15
    Registered User
    Join Date
    06-11-2017
    Location
    Richburg, SC
    MS-Off Ver
    O365 HOME
    Posts
    8

    Re: need help with IF in excel 2016

    its still not working... cell is always blank even with

    =IFERROR(1/(1/INDIRECT(LEFT(NAME,FIND(" ",NAME)-1)&"_Gas_Saturday_Initial")),"")

    I even tried making a cell with FIRSTNAME_LASTNAME set up a defined name of DEFINED_NAME and change formula

    =IFERROR(1/(1/INDIRECT(LEFT(DEFINED_NAME(" ",DEFINED_NAME)-1)&"_GAS_SATURDAY_INITIAL")),"")

    still blank
    Attached Images Attached Images
    Last edited by techmaster29729; 06-13-2017 at 11:16 PM.

  16. #16
    Registered User
    Join Date
    06-11-2017
    Location
    Richburg, SC
    MS-Off Ver
    O365 HOME
    Posts
    8

    Re: need help with IF in excel 2016

    how do i just keep it simple... like

    if name = "John Doe" do ISBLANKelse if name = "Jane Doe" do ISBLANK else if name = "Jean Doe" do ISBLANK

    =IF(NAME="John Doe",IF(ISBLANK(JOHN_GAS_SATURDAY_INITIAL),"",JOHN_GAS_SATURDAY_INITIAL),)
    IF(NAME="Jane Doe",IF(ISBLANK(JANE_GAS_SATURDAY_INITIAL),"",JANE_GAS_SATURDAY_INITIAL),)
    IF(NAME="Jean Doe",IF(ISBLANK(JEAN_GAS_SATURDAY_INITIAL),"",JEAN_GAS_SATURDAY_INITIAL),)

    tried this and it doesn't work results in #VALUE error!

  17. #17
    Registered User
    Join Date
    06-11-2017
    Location
    Richburg, SC
    MS-Off Ver
    O365 HOME
    Posts
    8

    Re: need help with IF in excel 2016

    well, i think I finally figured it out!

    =IFS(
    NAME="John Doe",IF(ISBLANK(JOHN_GAS_SATURDAY_INITIAL),"",JOHN_GAS_SATURDAY_INITIAL),
    NAME="Jane Doe",IF(ISBLANK(JANE_GAS_SATURDAY_INITIAL),"",JANE_GAS_SATURDAY_INITIAL),
    NAME="Jean Doe",IF(ISBLANK(JEAN_GAS_SATURDAY_INITIAL),"",JEAN_GAS_SATURDAY_INITIAL))

  18. #18
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: need help with IF in excel 2016

    I dont have ifS() on my version (2016), so cannot test that, but if it is working, it could be shortened a bit to this...
    =IFS(
    NAME="John Doe",IF(JOHN_GAS_SATURDAY_INITIAL="","",JOHN_GAS_SATURDAY_INITIAL),
    NAME="Jane Doe",IF(JANE_GAS_SATURDAY_INITIAL="","",JANE_GAS_SATURDAY_INITIAL),
    NAME="Jean Doe",IF(JEAN_GAS_SATURDAY_INITIAL="","",JEAN_GAS_SATURDAY_INITIAL))

  19. #19
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: need help with IF in excel 2016

    Thanks for the rep

+ 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. Replies: 23
    Last Post: 01-03-2022, 10:45 AM
  2. VBA surrounding embedding Google Maps in Excel not working in excel 2016
    By Dtrix in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-09-2016, 07:04 PM
  3. [SOLVED] VBA and Excel 2016
    By Saturn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-06-2016, 12:35 PM
  4. Replies: 2
    Last Post: 05-24-2016, 10:43 PM
  5. Had custom toolbar in older Excel for Mac, seeking similar functionality in Excel 2016
    By ianpage in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 05-13-2016, 11:06 AM
  6. Excel 2016 & beyond!
    By jewelsharma in forum The Water Cooler
    Replies: 6
    Last Post: 01-10-2016, 05:53 AM
  7. Replies: 23
    Last Post: 12-29-2015, 05:02 PM

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