+ Reply to Thread
Results 1 to 13 of 13

more help please <-noob learning curve

  1. #1
    Registered User
    Join Date
    11-15-2006
    Posts
    16

    more help please <-noob learning curve

    Ok i have a List box where the user selects a product, once selected the price appears in the box next to it (all good)

    now if no value is entered in the next row the box where the price should be has #NA in it - this i think is because no product is selected so the VLOOKUP command is returning a no value in the box.

    Now the probelm is when i try to use a SUM or range on the price column i get a #!value error becuae it wont count the #NA boxes as a value.

    Is there a way to format these cells with a 0 vale rather then #NA?

    can the validate data do this?

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Something like

    =if(isna(vlookup(A1,yourrange,2,false),0,vlookup(A1,yourrange,2,false)

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    11-15-2006
    Posts
    16
    thanks VBA

    where would i apply that though? in the cell doing the sum or in a validate?

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    I assumed it was to add on to your Vlookup to avoid the #N/A

    So just add the If(Isna part of the formula to your lookup.

    If you need more help upload a copy of yur file and we can get you the answer or give us the ranges etc and we can work it out for you

    e.g want you enter which gives the #N/A.

    If the Vlookup is giving #N/Afor a blank lookup cell you could just go

    =if(A1="","",Vlookup(A1,Yourrange,2,False)

    VBA Noob

  5. #5
    Registered User
    Join Date
    11-15-2006
    Posts
    16
    ok i tried it but it said there was a circular reference error

    what need the sheet to do is i need 150*k3 then i need to divide it by the total value in range I10:I200 but this throws the !value error because of the #NA's

    i cannot upload the file because it is 131kb zipped have you got an email i can send it to??

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Use this site

    http://www.savefile.com/

    VBA Noob

  7. #7
    Registered User
    Join Date
    11-15-2006
    Posts
    16
    cheers uploaded

    http://www.savefile.com/files/259523


    thanks again

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Would something like this work for you

    =SUM(IF(ISNUMBER(A1:A10),A1:A10))

    Change range as required

    It's an array so entered using Ctrl+Shift+Enter

    VBA Noob

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try these and drag down

    In E10

    =IF(D10="","",VLOOKUP(D10,fones,2,FALSE))

    In F10

    =IF(E10="","",E10*1.175)

    In G10

    =IF(D10="","",VLOOKUP(D10,fones,3,FALSE))

    In H10

    =IF(E10="","",C10+E10)

    In I10

    =IF(H10="","",150-H10)

    In J10

    =IF(I10="","",I10/1.175)

    and in K5 try

    =150*K3/SUM(I10:I200)

    VBA Noob

  10. #10
    Registered User
    Join Date
    11-15-2006
    Posts
    16
    thanks alot that has completely sorted it out!!!!!!!!!

  11. #11
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No problem

    Easier seeing the problem

    VBA Noob

  12. #12
    Registered User
    Join Date
    11-15-2006
    Posts
    16
    ok another kwiky for u, in column I how can i set it to on display and count the value less than 0.00 i.e i only want it to show -values and only summ the -values??

  13. #13
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try

    =SUMIF(I10:I100,"<0",I10:I100)

    Change range as required

    VBA Noob

+ 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