+ Reply to Thread
Results 1 to 22 of 22

Help on error using IF function

  1. #1
    Registered User
    Join Date
    10-24-2013
    Location
    saudi arabia
    MS-Off Ver
    Excel 2010
    Posts
    22

    Help on error using IF function

    Hi guys

    I write complicated code cuz am kinda low experince in Excel . ans it seems i need help.
    To know where I need help I should first explain how do I use the file

    We have some customers machines list
    2 Columns is important
    SMR = machine hour meter (D)
    Last job = last job opend in the system (E)

    when the machine reach 800 or above we open a job for 2000
    when the machine reach 1800 or above we open a job for 3000 ... (2800 goes to 4000 , 3800 goes to 5000 ... etc)

    other columes from (F) to (J) will look into (E) and do the following:
    - if the last job is equal to them it will show (Done).
    - if the last job is lower then them but the SMR is beigger it will show (YES)
    - if the last job is lower then them and the SMR lower it will not show anything

    as an example i use this formula for the colume (2000)
    Please Login or Register  to view this content.
    the problem is :
    some of the results show false and i can not fix it nether to know where is the mistake

    I have attached the file for more info and easier understanding.
    SMR UPDATE.xlsx

    I know its a chalange but I also know that u guys can do it.
    Thanks in advance

  2. #2
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Help on error using IF function

    Hi You are not using any condition on last if condition that why false result is occurring pls use as follow

    for 2000 =IF(E3=0," ",IF(E3>=2000,"DONE",IF(D3>E3,IF(D3>800,"YES"," "),"")))

    3000 = =IF(E2=0," ",IF(E2>=3000,"DONE",IF(D2>E2,IF(D2>1800,"YES"," "),"")))

    4000= =IF(E2=0," ",IF(E2>=4000,"DONE",IF(D2>E2,IF(D2>2800,"YES"," "),"")))


    and in the same way for 5000 and 6000

    many thanks
    Rishi

  3. #3
    Registered User
    Join Date
    10-24-2013
    Location
    saudi arabia
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Help on error using IF function

    Hi Rishi

    hmm interesting .. thx alot really :D

    I think i have got it in another way also
    for 2000
    Please Login or Register  to view this content.
    this will be shorter

    now can use it in VBA insted of paste this in all the columns ???
    I have more than 980 rows this will kill me lool

    any idea???

  4. #4
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Help on error using IF function

    sure you can just give some time ill be sharing with you macro...


    Click on the star if you think I helped you

  5. #5
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Help on error using IF function

    Please Login or Register  to view this content.
    Last edited by rishikrsaw; 12-30-2013 at 06:25 AM.

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Help on error using IF function

    rishikrsaw

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  7. #7
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Wink Re: Help on error using IF function

    Sorry fotis,

    now I put my code in code tag..

    sorry for inconvenience cause
    Last edited by rishikrsaw; 12-30-2013 at 06:26 AM.

  8. #8
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Help on error using IF function

    pls take of the range..

    many thanks

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Help on error using IF function

    rishikrsaw

    Ok. This is my last warning. If you continue to ignore Forum Rules amd Moderators requests, you'll be a Banned user.

  10. #10
    Registered User
    Join Date
    10-24-2013
    Location
    saudi arabia
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Help on error using IF function

    Rishi

    great work man i tryied it and it work just fine
    but it seems there is a problem
    when ever I delet any cell or row the code stop working i tried many ways but not working at all
    even i can not start it in new workbook

    can i have some aid pls

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Help on error using IF function

    What error do you get brdstyle?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  12. #12
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Help on error using IF function

    Hey brdstyle,

    I have made few changes on code after excluding the select and activate

    I have new enhanced version of code where our last code requered some manual task it is fully automated.


    pls use it and let me know if you have still any problem
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Help on error using IF function

    we can also create udf (user define function for it )

  14. #14
    Registered User
    Join Date
    10-24-2013
    Location
    saudi arabia
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Help on error using IF function

    Quote Originally Posted by arlu1201 View Post
    What error do you get brdstyle?
    Hi

    After finding the right way on how is the formula works am trying to get it in VBA insted of pasting it in all columns
    the formual is
    Please Login or Register  to view this content.
    this is for the first colume

    Rishi here is helping me alot

    but i dont know why when i use his code it never work
    even if i am using new workbook and save it as enabled macro file
    still not working automaticly

  15. #15
    Registered User
    Join Date
    10-24-2013
    Location
    saudi arabia
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Help on error using IF function

    Quote Originally Posted by rishikrsaw View Post
    Hey brdstyle,

    I have made few changes on code after excluding the select and activate

    I have new enhanced version of code where our last code requered some manual task it is fully automated.


    pls use it and let me know if you have still any problem
    Please Login or Register  to view this content.
    Rishi

    (

    still the same even in new workbook and also change the PC
    still not working automatic i dont know whats the problem really

  16. #16
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Help on error using IF function

    Hey can u pls check ur formula "=IF(E2=0," ",IF(E2>=2000,"DONE",IF(C2>800,"YES","")))"
    as value in c2 = "ALYAMAMA".....

    I think correct formula is =IF(E2=0," ",IF(E2>=2000,"DONE",IF(d2>800,"YES","")))"

    and I will be sending you the sheet in which i run the macro......

  17. #17
    Registered User
    Join Date
    10-24-2013
    Location
    saudi arabia
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Help on error using IF function

    Hi Rishi

    sorry for all the trouble

    this is the correct formula for the 2000 column
    Please Login or Register  to view this content.
    i hope we get it at the end

  18. #18
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Help on error using IF function

    You are saying you want it to work automatically? Can you elaborate on that?

  19. #19
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Help on error using IF function

    sure I will be sharing my sheet where I was working on....

  20. #20
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Help on error using IF function

    @arlu1201 I meant for automatic, where no need to feed data range as per the sheet as in if in column E there are 150 rows for "last job" so If using first vba code we need to put 150 else it will pick up range 1500

    my new vba code doesn't requited to put 150 or any data range. it will automatically pick up range where is the column e laying...

    I think, I have elaborated

  21. #21
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Help on error using IF function

    pls use this sheet and do let me know incase of query
    Attached Files Attached Files

  22. #22
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Help on error using IF function

    Quote Originally Posted by rishikrsaw View Post
    @arlu1201 I meant for automatic, where no need to feed data range as per the sheet as in if in column E there are 150 rows for "last job" so If using first vba code we need to put 150 else it will pick up range 1500

    my new vba code doesn't requited to put 150 or any data range. it will automatically pick up range where is the column e laying...

    I think, I have elaborated
    Rishikrsaw,

    I am asking brdstyle about it. He needs to elaborate as per the requirement.

+ 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] Error in function Compile error: Can't find project or library
    By Motario1 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-12-2013, 02:20 AM
  2. index function error using match function to get data from a cell in an array
    By mabildgaard in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2013, 02:21 AM
  3. [SOLVED] User defined function returns an error on a standard function used in it.
    By pb48 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2013, 01:35 PM
  4. #Name Error in function, cannot run function with green arrow in editor.
    By staplegunz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-29-2011, 11:50 AM
  5. [SOLVED] Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04:05 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