MX Record Lookup Function in Powershell

Hey Guys, I am looking to get a script running on a weekly basis that takes the information provided by the get-accepteddomain cmdlet and performs an MX lookup for each DomainName.  After the Script has performed the lookups I would like to have it
e-mail the information.
I've found a great function for getting the MX record information and it works great.  I'm struggling with how to perform a foreach with the function using data provided by the get-accepteddomain cmdlet and then e-mail the results.
### Function to get the MX Records for a domain
### Usage: Get-DnsMXQuery -DomainName "gmail.com"
### Reference: http://serverfault.com/questions/164508/anyone-have-a-powershell-script-to-look-up-the-mx-record-for-a-domain
function Get-DnsAddressList
    param(
        [parameter(Mandatory=$true)][Alias("Host")]
          [string]$HostName)
    try {
        return [System.Net.Dns]::GetHostEntry($HostName).AddressList
    catch [System.Net.Sockets.SocketException] {
        if ($_.Exception.ErrorCode -ne 11001) {
            throw $_
        return = @()
function Get-DnsMXQuery
    param(
        [parameter(Mandatory=$true)]
          [string]$DomainName)
    if (-not $Script:global_dnsquery) {
        $Private:SourceCS = @'
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace PM.Dns {
  public class MXQuery {
    [DllImport("dnsapi", EntryPoint="DnsQuery_W", CharSet=CharSet.Unicode, SetLastError=true, ExactSpelling=true)]
    private static extern int DnsQuery(
        [MarshalAs(UnmanagedType.VBByRefStr)]
        ref string pszName,
        ushort     wType,
        uint       options,
        IntPtr     aipServers,
        ref IntPtr ppQueryResults,
        IntPtr pReserved);
    [DllImport("dnsapi", CharSet=CharSet.Auto, SetLastError=true)]
    private static extern void DnsRecordListFree(IntPtr pRecordList, int FreeType);
    public static string[] Resolve(string domain)
        if (Environment.OSVersion.Platform != PlatformID.Win32NT)
            throw new NotSupportedException();
        List<string> list = new List<string>();
        IntPtr ptr1 = IntPtr.Zero;
        IntPtr ptr2 = IntPtr.Zero;
        int num1 = DnsQuery(ref domain, 15, 0, IntPtr.Zero, ref ptr1, IntPtr.Zero);
        if (num1 != 0)
            throw new Win32Exception(num1);
        try {
            MXRecord recMx;
            for (ptr2 = ptr1; !ptr2.Equals(IntPtr.Zero); ptr2 = recMx.pNext) {
                recMx = (MXRecord)Marshal.PtrToStructure(ptr2, typeof(MXRecord));
                if (recMx.wType == 15)
                    list.Add(Marshal.PtrToStringAuto(recMx.pNameExchange));
        finally {
            DnsRecordListFree(ptr1, 0);
        return list.ToArray();
    [StructLayout(LayoutKind.Sequential)]
    private struct MXRecord
        public IntPtr pNext;
        public string pName;
        public short  wType;
        public short  wDataLength;
        public int    flags;
        public int    dwTtl;
        public int    dwReserved;
        public IntPtr pNameExchange;
        public short  wPreference;
        public short  Pad;
        Add-Type -TypeDefinition $Private:SourceCS -ErrorAction Stop
        $Script:global_dnsquery = $true
    [PM.Dns.MXQuery]::Resolve($DomainName) | % {
        $rec = New-Object PSObject
        Add-Member -InputObject $rec -MemberType NoteProperty -Name "Host"        -Value $_
        Add-Member -InputObject $rec -MemberType NoteProperty -Name "AddressList" -Value $(Get-DnsAddressList $_)
        $rec
### END Function
The funtion above does a great job of pulling the mx records for a domain
Example Output:
[PS] C:\>Get-DnsMXQuery -DomainName godaddy.com
Host                                                                      
AddressList
mailstore1.secureserver.net                                               
216.69.186.201
smtp.secureserver.net                                                     
216.69.186.201
Example Output "Get-AcceptedDomain
[PS] C:\>Get-AcceptedDomain
Name                           DomainName                    
DomainType                                  Default
Godaddy.com                    Godaddy.com                    Authoritative                              
True
Warmest Regards,
Kelsey

Hi Kelsey
For send e-mail using Script, you could refer to Blog, Send Email from Exchange Online by Using PowerShell
http://blogs.technet.com/b/heyscriptingguy/archive/2011/09/24/send-email-from-exchange-online-by-using-powershell.aspx
If you need foreach loop for just simple SMTP sending, the format should be
$MBs = Get-Mailbox
Foreach($MB in $MBs){
$message = New-Object Microsoft.Exchange.WebServices.Data.EmailMessage -ArgumentList $service
$message.Subject = 'Test is a test'
$message.Body = 'This message is being sent through EWS with PowerShell'
$message.ToRecipients.Add($MB.UserPrincipalName)
$message.SendAndSaveCopy()
Cheers
Zi Feng
Zi Feng
TechNet Community Support

Similar Messages

  • Group by Lookup function result

    I have a report that uses two datasets.
    The first one looks like this. It's the time members have recorded under a particular job title:
    ParentId TaskName ObjectiveId MemberId JobTitle TimeSpent Status
    3174ED19 TEST 3 42AA79F6 23179C0F NULL 0.00 01
    3174ED19 TEST 3 42AA79F6 596CA495 JobTitle1 9.00 01
    3174ED19 TEST 1 AEE18C46 23179C0F NULL 0.00 01
    3174ED19 TEST 1 AEE18C46 596CA495 JobTitle2 3.00 01
    3174ED19 TEST 2 AEE18C46 23179C0F NULL 0.00 01
    3174ED19 TEST 2 AEE18C46 596CA495 6.00 01
    I need to show the records which have JobTitle == null with a particular Job Title, the current one they have in Active Directory. So I use another dataset from a WCF service:
    MemberId Name JobTitle
    23179C0F Member1 JobTitle1
    Then I use a lookup function to show the correct Job Title:
    =IIF(IsNothing(Fields!JobTitle.Value) OR Fields!JobTitle.Value = "",lookup(Fields!MemberId.Value,Fields!MemberId.Value,Fields!JobTitle.Value,"Members"),Fields!JobTitle.Value)
    This works ok. The problem is that I need the data to be grouped by several fields, including the Job Title. It seems grouping happens before the lookup function is executed, so instead of grouping the NULL values along with the fields that contains the actual
    values, I end up with two groups with the same Job Title, one containing the null values and another with the actual values.
    Is there any workaround for this?
    Thanks.

    Hi EXR88,
    Per my understanding that you have add some row group in the report to group the result which include the JobTitle from the table1 and also group by the field which result comes from the lookup funtion, now the issue is the group by the Lookup function result
    isn't correct, right?
    I have tested on my local envoronment and can't reproduce the issue, please find the details information below to make sure you have done the correct setting:
    I tried to create the two tables like below:
    Table1:
     Have the same recores as you provided above.
    Table2:
    MemberId    Name      JobTitle
    23179C0F   Member1    JobTitle1
    596CA495   Member1      NULL
    After adding the LookUP function, i got the report like below:
    I add two row group base on the JobTitle(JobTitle) and the Lookup functiuon result(Lookupfunctiongroup), the Lookupfunctiongroup row group is the child group of the JobTitle like below, please make sure you have add the expression with the lookupfunction
    in the group on:
    If i have some misunderstanding, please try to provide the expectted group by  result you want to get and also the currectly result you have got.
    Any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Lookup function issue or specific cell data binding problem

    I  have a dataset which has datatable having 2 columns i.e
    Table( Id string,Value string)
    Every single record in the datatable represents an answer to particular question, Id column being question identifier and Value column  being an answer and every question has answer being stored for 7 days.
    Now i have designed a report which is in the form of grid like
                         Day1 Answer, Day2 Answer, Day3 Answer............................Day7 Answer
    Question 1 
    Question 2
    .Question 40
    I tried using lookup function in ssrs reporting service to bind every single cell in the report using data from dataset like
    = Lookup("question_identifier",QuestionId.Value,AnswerValue.Value,"mydataset");
    The report is working absolutely fine in the report designer as expected but when i take it to the ASP.NET website where i have to generate it, it never shows up and i get report couldn't be found and make sure you have published the report kind of errors.
    I figured that this is the problem with lookup function because as soon as i removed all lookup function expressions in the report , the report started to show up but without data.
    Please let me know if there is another way to go around this problem or fix this issue.
    Thanks,
    BR,

    Hi Jolly,
    I don't think we need lookup function for this. We have only one dataset, the report can be easily created by simply modifying the query of the dataset and place those fields in the tablix report. Refer below example,
    create table reporttable(id int, value varchar(200))
    insert into reporttable values(1,'abc')
    insert into reporttable values(1,'abc1')
    insert into reporttable values(1,'abc2')
    insert into reporttable values(1,'abc3')
    insert into reporttable values(1,'abc4')
    insert into reporttable values(2,'abc')
    insert into reporttable values(2,'abc1')
    insert into reporttable values(2,'abc2')
    insert into reporttable values(2,'abc3')
    insert into reporttable values(2,'abc4')
    insert into reporttable values(3,'abc')
    insert into reporttable values(3,'abc1')
    insert into reporttable values(3,'abc2')
    insert into reporttable values(3,'abc3')
    insert into reporttable values(3,'abc4')
    select id as [Question],'Day ' + cast(row_number() over (partition by id order by id) as varchar) + ' Answer' as AnsCol
    from reporttable
    Regards, RSingh

  • Issues updating/setting multi value lookup columns via powershell

    Hi All,
         I have an issue updating multi values in a lookup field via powershell
    I can update a single value  lookup field as below but can't get to update if its multi value.
    As stated below when I hardcode it. It works.
    No idea what 'm missing. Any help will be appreciated.
    #Hardcoded works below as you can see i'm setting 3 values
    $array = @($realval.Split(';'))
    for ($i = 0; $i -lt $array.Count - 1; $i += 2)
    $word = $array[$i].Trim('#')
    $number = $array[$i+1].Trim('#')
    "$number $word"
    $lookupvalue1 = GetLookUpValues -val $number
    [Microsoft.SharePoint.SPFieldLookupValueCollection] $itemValues = New-Object Microsoft.SharePoint.SPFieldLookupValueCollection
    [Microsoft.SharePoint.SPFieldLookupValue] $lookupvalue = New-Object Microsoft.SharePoint.SPFieldLookupValue
    [Microsoft.SharePoint.SPFieldLookupValue] $lookupvalue2 = New-Object Microsoft.SharePoint.SPFieldLookupValue
    [Microsoft.SharePoint.SPFieldLookupValue] $lookupvalue3 = New-Object Microsoft.SharePoint.SPFieldLookupValue
    $lookupvalue.LookupId = 1
    $lookupvalue2.LookupId = 2
    $lookupvalue3.LookupId = 6
    $itemValues.Add($lookupvalue)
    $itemValues.Add($lookupvalue2)
    $itemValues.Add($lookupvalue3)
    #$itemValues.Add($lookupvalue)
    $CMRSItems["Event Type"] = $itemValues;
    Write-Host "items:" $itemValues
    $CMRSItems.Update()
    # This works when its updating only one value but when it needs to update multivalue it only updates the last one
    #so for example with the lookupvalue above only 6 gets updated below
    $array = @($realval.Split(';'))
    for ($i = 0; $i -lt $array.Count - 1; $i += 2)
    $word = $array[$i].Trim('#')
    $number = $array[$i+1].Trim('#')
    #$number
    "$number $word"
    #send param to GetLoolValues func to return records as SPFieldLookupValue
    $lookupvalue1 = GetLookUpValues -val $number
    #I can view the lookupvalue returned successfully
    #Write-Host $lookupvalue1
    [Microsoft.SharePoint.SPFieldLookupValueCollection] $itemValues = New-Object Microsoft.SharePoint.SPFieldLookupValueCollection
    #This LookupId returns 3 values like on the hardcoded one above like so :1,2,6
    $lookupvalue.LookupId = $number
    $itemValues.Add($lookupvalue)
    $CMRSItems["Event Type"] = $itemValues;
    #I can view the items returned successfully
    Write-Host "items:" $itemValues
    $CMRSItems.Update()

    The problem I can see with your code is that the below line of code, you are instantiating inside the for loop. This should have been outside the for loop as by keeping it inside the loop you are overriding the value.
    [Microsoft.SharePoint.SPFieldLookupValueCollection] $itemValues = New-Object Microsoft.SharePoint.SPFieldLookupValueCollection
    Please have a look at the below solution and modify your code as per your requirement. What I am trying to achieve in the below code is that I have a listA in which one of the field is being used as a multi-lookup in my listB.
    $lookupCollection = $something.split(";")
    $LookupMasterList=$web.Lists["ListA"]
    [Microsoft.SharePoint.SPFieldLookupValueCollection] $lookupValueCollection = New-Object Microsoft.SharePoint.SPFieldLookupValueCollection
    #Get the Lookup Item from Parent List
    foreach($item in $lookupCollection){
    IF([string]::IsNullOrEmpty($item.trim())) {
    continue;
    $LookupItem = $LookupMasterList.Items | Where-Object { $_.Item("FieldInternalName") -eq $item.trim()}
    if($LookupItem -ne $null)
    $myLookup = New-Object Microsoft.Sharepoint.SPFieldLookupValue($LookupItem.ID,$item.trim())
    $lookupValueCollection.Add($myLookup);
    #Set the Lookup field value
    if([string]::IsNullOrEmpty($lookupValueCollection)){
    continue;
    else{
    $newItem["Lookupfieldinternalname"] = $lookupValueCollection
    The above logic has no hard coding and it fetches the lookup information directly from the master list and generates a collection based on that. You can modify the above code as per your requirement.
    Geetanjali Arora | My blogs |

  • MX record lookup

    Ihave a OS X Server running and use my TimeCapsule as DNS. The mailserver cannot make MX record lookup throug the TimeCapsule... there are no problems in reciving mails, and port 25 is open.

    Hi Kelsey
    For send e-mail using Script, you could refer to Blog, Send Email from Exchange Online by Using PowerShell
    http://blogs.technet.com/b/heyscriptingguy/archive/2011/09/24/send-email-from-exchange-online-by-using-powershell.aspx
    If you need foreach loop for just simple SMTP sending, the format should be
    $MBs = Get-Mailbox
    Foreach($MB in $MBs){
    $message = New-Object Microsoft.Exchange.WebServices.Data.EmailMessage -ArgumentList $service
    $message.Subject = 'Test is a test'
    $message.Body = 'This message is being sent through EWS with PowerShell'
    $message.ToRecipients.Add($MB.UserPrincipalName)
    $message.SendAndSaveCopy()
    Cheers
    Zi Feng
    Zi Feng
    TechNet Community Support

  • Master/Detail/Lookup functionality - ApEx and AJAX vs Oracle Forms

    I'd like to build a master detail form with some lookup functionality and have some of the fields automatically populated. I come from an Oracle Forms and PL/SQL background so I was hoping for some guidance in ApEx and Javascript for how to achieve the same effect.
    If you look at the default Sample Application (DEMO_APP), page 29 has the master record and the corresponding details on the same page.
    The functionality I'd like is:
    1) when a new product is chosen from the Product Name select list, I'd like the Unit Price to be populated.
    2) when the Quantity is updated, I'd like
    a) the Extended Price to be recalculated and
    b) the Order Total to be recalculated
    all before submitting the page. This is pretty trivial in Oracle Forms but I've had limited success with ApEx.
    I've been able to achieve 1) in a single record form but not a tabular form using the techniques from Scott's AJAX generator http://htmldb.oracle.com/pls/otn/f?p=33867:2.
    I've been able to achieve 2a) in a tabular form using the techniques from Vikas in this thread Tabular form with Ajax
    I haven't had any luck getting 2b) to work.
    So, is my wish list possible?
    If it is, I'd appreciate some pointers and/or code. I don't speak Javascript but I can copy and paste ;)
    Cheers,
    Bryan.

    Hi Carl,
    Ok, thanks for the tip - take a look at http://htmldb.oracle.com/pls/otn/f?p=24745 login as demo/demo and edit one of the top orders. This will take you to page 29.
    I've changed the 2.0 Sample Application to allow both the unit_price and the quantity to be overtyped. Each column has the 'Element Attributes' property set to onChange="calcTotal(this)" to call the javascript code.
    This recalculates the extended_price (feature 2a above) but the order total (or the report total) is not affected (feature 2b) - how can I change the code to achieve this?
    If I change an existing line item and choose another product from the select list, I'd like the unit_price and the extended_price to change appropriately (feature 1 above) - having to wait until after the form is submitted is not acceptable to my users.
    Thanks for taking the time to look at this - I really appreciate it.
    Cheers,
    Bryan.

  • Is there a way of getting LOOKUP function to return the address of a cell rather than the value?

    Hi
    I am wondering if there is a way of converting the value found in a LOOKUP function into a reference for the cell in question.
    I have constructed the following formula:
    =OFFSET(LOOKUP(A2,August :: $A),2,2)
    In an attempt to return the value of a cell which is two rows and two columns away from the cell returned by a LOOKUP function.
    But I am getting the error Argument 1 of OFFSET expects a reference but found "Name."
    Could someone advise?
    Thanks,
    Nick

    nick_harambee wrote:
    Hi
    I am wondering if there is a way of converting the value found in a LOOKUP function into a reference for the cell in question.
    I have constructed the following formula:
    =OFFSET(LOOKUP(A2,August :: $A),2,2)
    In an attempt to return the value of a cell which is two rows and two columns away from the cell returned by a LOOKUP function.
    But I am getting the error Argument 1 of OFFSET expects a reference but found "Name."
    Could someone advise?
    Thanks,
    Nick
    Nick,
    To find the row that a searched-for value is in, use MATCH.
    Jerry

  • SSRS countrow Aggregate error(Aggregate and lookup functions cannot be used in query parameter expressions.)

    Below expression works fine with text box but gives error in dataset expression.
    ="SET FMTONLY OFF select  "+ join(Parameters!Column.Value,",") +" FROM pamcustom.dbo.vw_HFL_HFD_HotfileData INNER JOIN pamcustom.dbo.HFL_HFB_HotFileBatch  on BatchID = HFB_intBatchID where BatchID ="+Parameters!BatchId.Value+"
    and "+Parameters!cmbTranType.Value+" "+ iif(CountRows("DS_Aml_Mnr_Iss_Desc")=Parameters!Mnr_Iss_Desc.count," "," and aml_mnr_iss_desc in "+"('" & join(Parameters!Mnr_Iss_Desc.Value,"','")
    & "')")+iif(CountRows("ds_ReportingCategory")=Parameters!ReportingCategory.count," "," and ReportingCategory in "+"('" & join(Parameters!ReportingCategory.Value,"','") & "')")+iif(CountRows("ds_NAICSubGroup")=Parameters!NAICSubGroup.count,"
    "," and naicsubgroup in "+"('" & join(Parameters!NAICSubGroup.Value,"','") & "')")+iif(CountRows("ds_PortTrading")=Parameters!PortTrading.count," "," and porttrading in "+"('"
    & join(Parameters!PortTrading.Value,"','") & "')")+iif(CountRows("ds_GL_LE")=Parameters!GL_LE.count," "," and gl_le in "+"('" & join(Parameters!GL_LE.Value,"','") &
    "')")+iif(CountRows("ds_coagroup")=Parameters!cmbCoaGrp.count," "," and coagroup in "+"('" & join(Parameters!cmbCoaGrp.Value,"','") & "')")+iif(CountRows("Portfolio")=Parameters!cmbPort.count,"
    "," and portfolio in "+"('" & join(Parameters!cmbPort.Value,"','") & "')")+IIf(IsNothing(Parameters!txtSecID.Value)," "," and secid in ('"+Replace(Parameters!txtSecID.Value,",","','")+"')")+iif(IsNothing(Parameters!minPortFilter.Value)
    and IsNothing(Parameters!MinPort.Value)," "," and portfolio "+Parameters!minPortFilter.Value+Parameters!MinPort.Value)+iif(IsNothing(Parameters!maxPortFilter.Value) and IsNothing(Parameters!MaxPort.Value)," ","
    and portfolio "+Parameters!maxPortFilter.Value+Parameters!MaxPort.Value)+iif(IsNothing(Parameters!minCoaFilter.Value) and IsNothing(Parameters!txtMinCoa.Value)," "," and portfolio "+Parameters!minCoaFilter.Value+Parameters!txtMinCoa.Value)+iif(IsNothing(Parameters!maxCoaFilter.Value)
    and IsNothing(Parameters!txtMaxCoa.Value)," "," and portfolio "+Parameters!maxCoaFilter.Value+Parameters!txtMaxCoa.Value)
    I guess the error " Aggregate and lookup functions cannot be used in query parameter expressions." is because I am using CountRow to ensure that if all values of multi select all selected i will not use that filter in where clause.
    Pls. guide...

    Hi, Include your parameter total count in the dataset for parameter and instead of using countrows() function use the count from dataset in the expression.
    Hope this helps.........
    Ione

  • Dense Lookup Function in OBIEE

    Hi ,
    Can someone please explain the syntax of Dense Lookup Function in OBIEE.
    The function in the built-in RPD is using too many arguments and I am not able to understand it.
    Thanks in Advance for the help.
    Akshatha

    I had actually seen all those links. Thanks for your time although.
    Actually, I have an expression like this.
    lookup( DENSE LookupTable.DOMAIN_MEMBER_NAME, 'MCAT', 'CMP' || '~' || Table_A.TOP_LVL_PRODCAT_ID, VALUEOF(NQ_SESSION.USER_LANGUAGE_CODE), Table_A.DATASOURCE_NUM_ID)
    I am not sure of what 'MCAT' and 'CMP' is here?
    Is the || the concatenation operator?
    Can you please explain this expression?
    I hope I am not asking too much here :/
    Akshatha

  • USING LOOKUP FUNCTION IN CHART

    Good Afternoon,
    I have created a simple chart in SSRS that is sourced from Analysis Services. The Grouping is by Month and the values are just attendances per month.
    I want to add a 2nd series to this chart using a stored procedure in SQL.
    Both share the field Month and could be linked on that field.
    Does anybody know how I can use the lookup function to add this field to my chart.
    Thank you

    You can lookup by month. In the chart values, add a new series by clicking the Plus icon and choosing Expression. You expression should look something like:
    =Lookup( Fields!AS_Month.Value, Fields!SP_Month.Value, Fields!SP_Value.Value, "SP_Dataset" )
    The abbreviation AS refers to your analysis services dataset, while the SP refers to your dataset using the stored procedure. The expression matches each month used in the chart (the category group) with the month in the other data set, and retrieves the
    SP_Value field to show on the chart.
    If the month numbers/names match exactly, then it will work fine.
    Regards,
    Andrew Borg Cardona

  • Lookup functionality

    Hi Guru's,
    How to implement informatica's lookup functionality in ODI. Any help is appreciated.
    Thanks,
    Navin Kumar Bolla

    Have a read of :- Lookups in ODI
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • There is an error in the process of validating the lookup function in NW

    Hi,
    I got an error in the script logic validation.
    I  write a lookup function and validate the logic, In this one error occurred "Invalid lookup strecture: Invalid appl name"
    The logic code:
    *LOOKUP Staff_Additions                
    *DIM Salary="Salary_redis"     
    *DIM Category="Budget"     
    *DIM Client_Group="1010"     
    *DIM DataSrc="Input"     
    *DIM Intco="Non_Interco"     
    *DIM RptCurrency="LC"     
    *DIM Time="2011.MAR"
    *DIM Account="41000"
    *ENDLOOKUP
    *When Category.ID
    *Is = "Budget"
    *WHEN INTCO.ID
    *Is = "NON_INTERCO"
    *When JOB_TITLE.ID
    *Is = "NO_JOBTITLE"
    *When SALARY.ID
    *Is = "SALARY_REDIS"
    *When RptCurrency
    *Is = "LC"
    *When DATASRC
    *Is = "INPUT"
    REC(Expression=ROUND(.07692 Lookup(Staff_Additions),0),Time="2010.APR",SALARY="SALARY_MO")
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    Could you please send a solution for this as early as possible.
    Thanks and Regards,
    Krishna.

    Hi,
    I think you have confused in your syntax "Model" and "Lookup ID".
    The syntax of Lookup is this:
    *LOOKUP
    *DIM [:]="Value" | [.]
    So when you reference your lookup variable in the *REC statement it should look something like this:
    REC(Expression=ROUND(.07692 Lookup(<LOOKUP ID>),0),Time="2010.APR",SALARY="SALARY_MO")
    whereas now you have:
    REC(Expression=ROUND(.07692 Lookup(<MODEL>),0),Time="2010.APR",SALARY="SALARY_MO")
    HTH
    Matthias

  • Palm Desktop 6.2.2. and Lookup function not working in Windows 7

    Palm Desktop's lookup function not working in Windows 7 64bit. Please help.
    Post relates to: Centro (Verizon)
    This question was solved.
    View Solution.

    I was able to solve this by unchecking compatibility mode and setting the application to run as administrative.

  • Using the lookup function in Numbers '09

    I'm looking for the way to have the lookup function in Numbers '09 return an error for a non-exact match.  Eg. I want an invalid part number to state this, but currently all I can get is the return of data for the closest match.  Thank you.

    when you use the VLOOKUP() function the last, optional, argument can request and exact match.  When an exact match is not available VLOOKUP() will return an error.
    you can use the IFERROR() function to trap errors like this:
    =IFERROR(<FUNCTION_TO_TRY>, "NOT FOUND")
    In your case.... if <FUNCTION_TO_TRY> is you VLOOKUP(<WHAT_TO_FIND>, <RANGE>, <COLUMN>, 0), the "0" specifies exact match and you could then place all this in the IFERROR() like this:
    =IFERROR(VLOOKUP(<WHAT_TO_FIND>, <RANGE>, <COLUMN>, 0) "NOT FOUND")
    <WHAT_TO_FIND> is what to look for,
    <RANGE> is where to look,
    <COLUMN> is the number of the column in the range you want to return

  • Using lookup function but to show multiple returns?

    Okay so I have been talked through how to use a lookup function to show which student in my class has scored the highest grade.  The formula used displays there name in one column and the score they achieved in another column which I have set up in a small seperate table.  However as suggested in my intial lookup function search it was suggested that I would encounter a problem if two students both achieved the same highest score.  However in the results table I have created it only shows one student.  Is it possible to have a function or formula that will simply show the top scores and the students that scored it when they are tied? 
    Thanks
    Marcus

    The easiest way to accomplish this, Marcus, is by simply sorting all rows by grade.  Sure, you can click on the column tab and hit "sort ascending", but I'm guessing you want something a little more dynamic than that.
    So I've set up a class of 20 students and gave them all random grades btwn 40 - 99.  (That's how it was done when I was in high school.  )  I added a third column which takes that grade, multiplies it by 1000, and adds the row number of the student.  This creates a unique identifier based on a possibly-non-unique grade:
    Now it's simply a matter of using the LARGE function to rank these new identifiers, and then using LOOKUP to get the actual grade and name for that identifier.  (Note that the grades changed; changing the focus from one cell to another creates new random values for the grades.)
    The formula for columns b and c for this Ranking table are standard Lookup functions:
    =LOOKUP($A1,Grades :: $C,Grades :: $B) to get the grades  ($A2 for 2nd column, etc.), and
    =LOOKUP($A1,Grades :: $C,Grades :: $A) to get the names.
    I'd suggest hiding these identifier columns.
    Now, to limit this display to the "X" highest grades, I'm going to continue this into another reply.
    Vince

Maybe you are looking for

  • How can we bind Two Static Lists to a single Column.

    Hi All, My requirement is 1) I have two different Static List's. 2) These two static list's are saved to the same column in the database table. 3) In the UI, I will be having different dropdown's. And each dropdown is bound to this column. Say if I h

  • Urgent help needed in code

    Hi iam copying data to table control from ztable. say i copied into my table control 20 rows. sayy i have my 18 row material field incorrect, i have an error message. for some reason my loop in PAI does looping for only first 11 rows. After the 11 ro

  • Start-Up from external hard-drive with Time Machine

    I am using a 500GB Firewire/USB-2 external drive as my back-up, using Time Machine. I've looked all over (and read Bob Levitus's book) for an answer: How do I set up this external drive to automatically boot, in the event of internal drive (iMac) fai

  • ATV can it be linked to more than one computer.

    I am using a iMac 2008 and a MacBook unibody 2009 with sharing in iTunes. Can I set up ATV on both computers? If I can How is it done?

  • Indesign Post Script name changing to back up file name

    Hi all I am in a pre press workflow that requires that I write a post-script file to a hot folder. So saving as a post-script is the only option for our entire workflow to take place. When saving the post script file from indesign , the name defaults