+ Reply to Thread
Results 1 to 15 of 15

Help with if statement (not even sure that's the best formula..)

  1. #1
    Registered User
    Join Date
    05-27-2014
    MS-Off Ver
    2013
    Posts
    21

    Help with if statement (not even sure that's the best formula..)

    I need help with a formula - I have attached an example of the data (Excel 2013)

    I need to validate data across 4 fields and all fields will be linked to the data entered on the system for Onshore_Offshore:

    If Onshore is selected then the following field, Site, should have South Africa, the City should be on the list of South African cities, and the building should be based in the right city (refer to name manager for parameters).

    I've tried using an IF statement but am not getting the results I need - not sure if there's a better formula to use or if I'm just not getting it right with the IF statement (have tried multiple IF statements, constructed in various ways to include ISNA and MATCH in some).

    Any sort of help with this would be most appreciated!
    Attached Files Attached Files
    Last edited by birdie27; 06-06-2016 at 07:21 AM.

  2. #2
    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,938

    Re: Help with if statement (not even sure that's the best formula..)

    Birdie, welcome to the forum

    While I am looking at your file, please update your profile as necessary to properly reflect the exact version(s) of Excel your question relates to, as well at your location. Members tailor answers based on your Excel version.
    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

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

    Re: Help with if statement (not even sure that's the best formula..)

    OK so where will you entering this data?
    is what you have in that file, your "database"?

  4. #4
    Registered User
    Join Date
    05-27-2014
    MS-Off Ver
    2013
    Posts
    21

    Re: Help with if statement (not even sure that's the best formula..)

    The data is extracted from a system as an xlsx file - what I have in the example file is the policy sheet - the data file contains numerous other fields to all be validated, it's just this cross-validation that I am struggling with.

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

    Re: Help with if statement (not even sure that's the best formula..)

    OK, so can you provide a sample of the data you are working with, and show what you expect please?

    (and please, update your profile )

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

    Re: Help with if statement (not even sure that's the best formula..)

    I believe what you want is dependent drop-downs: see "Sheet2"

    General formula for Data Validation;

    Allow =List

    Source: =INDIRECT(A2)

    or

    Source: =INDIRECT(Substitute(C2," ",""))

    or

    =INDIRECT(SUBSTITUTE(SUBSTITUTE($B$2,"India - ","")," ",""))
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-27-2014
    MS-Off Ver
    2013
    Posts
    21

    Re: Help with if statement (not even sure that's the best formula..)

    I have attached another file with an example of data (see comments for examples of incorrect data)

    Worksheet still contains policy sheet
    Attached Files Attached Files

  8. #8
    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,910

    Re: Help with if statement (not even sure that's the best formula..)

    Birdie - which version of Excel are you using? Please do as you have been asked and update your profile to show this: it makes it easier for helpers to advise you.
    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.

  9. #9
    Registered User
    Join Date
    05-27-2014
    MS-Off Ver
    2013
    Posts
    21

    Re: Help with if statement (not even sure that's the best formula..)

    I have been trying to update the profile - the profile page is not loading.

    I am using 2013

  10. #10
    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,910

    Re: Help with if statement (not even sure that's the best formula..)

    OK - understood. Thanks for the information.

  11. #11
    Registered User
    Join Date
    05-27-2014
    MS-Off Ver
    2013
    Posts
    21

    Re: Help with if statement (not even sure that's the best formula..)

    No problem still trying to get onto the profile page to update

  12. #12
    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,208

    Re: Help with if statement (not even sure that's the best formula..)

    Why not do your selections using the dependent drop down approach: it is "self-validating".

  13. #13
    Registered User
    Join Date
    05-27-2014
    MS-Off Ver
    2013
    Posts
    21

    Re: Help with if statement (not even sure that's the best formula..)

    I unfortunately won't be able to use dropdowns because the data is not entered onto the sheet, it is entered into an online system, and the data is then extracted from there as a raw data file which requires validation

  14. #14
    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,208

    Re: Help with if statement (not even sure that's the best formula..)

    See attached.

    Formula are similar to DV formula:

    e.g.

    =IFERROR(IF(MATCH(B2,INDIRECT(A2),0),""),"Incorrect Site")

    I would consider changing the "India" sites to remove "India - " from the names to avoid (minimise) using the SUBSTITUTE function to match your named ranges.
    Attached Files Attached Files
    Last edited by JohnTopley; 06-03-2016 at 11:41 AM.

  15. #15
    Registered User
    Join Date
    05-27-2014
    MS-Off Ver
    2013
    Posts
    21

    Re: Help with if statement (not even sure that's the best formula..)

    Hi All,

    Thanks for your help - I managed to come right with IF statements

+ 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] IF statement clause and SUMIF statement formula help!!!!
    By djmatok in forum Excel Formulas & Functions
    Replies: 28
    Last Post: 10-28-2015, 04:48 PM
  2. Statement to return formula to the next row down, if formula's result if false?
    By AlphaRaveNZ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-12-2015, 10:54 PM
  3. Statement to return formula to the next row down, if formula's result if false?
    By AlphaRaveNZ in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-12-2015, 10:54 PM
  4. [SOLVED] Glitched formula? IF statement does not work because of a formula in a reference cell
    By Tworksheets in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-04-2013, 02:16 PM
  5. [SOLVED] Formula for Income Statement in financial statement
    By Zunit in forum Excel General
    Replies: 6
    Last Post: 07-02-2012, 02:21 PM
  6. if statement formula
    By skatmandu2002 in forum Excel General
    Replies: 2
    Last Post: 03-12-2008, 09:01 PM
  7. Replies: 1
    Last Post: 07-20-2006, 03:05 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