Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6601149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:42:56+00:00 2026-05-25T18:42:56+00:00

I’m trying to convert some Excel formulas into C# code, and I’m kind of

  • 0

I’m trying to convert some Excel formulas into C# code, and I’m kind of lost…

I have the following:

SUMPRODUCT(1*(RIGHT(A1)={"a","e","i","n","y"}))

What exactly does that mean?

Here is what I know:

  • RIGHT(A1) returns the last character of the text in A1.
  • SUMPRODUCT({1,2,3}, {4,5,6}) returns 1*4 + 2*5 + 3*6 (something like a scalar product, right?)

but here is what I don’t understand:

If the text is Claude, for example…

RIGHT(A1)={"e","a","b","c","d"} returns TRUE

and

RIGHT(A1)={"a","b","e","c","d"} returns FALSE

I only changed the index position of the e character.

What is happening there?
What I’m not understanding?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:42:57+00:00Added an answer on May 25, 2026 at 6:42 pm

    Basically the formula is checking if the last character in cell A1 is any of the following characters: a, e, i, n, or y. The SUMPRODUCT part is important because it is a hack to check the entire array at once against the last character. When you strip that part out and just use RIGHT(A1)={"a","b","e","c","d"}, Excel actually only looks at the first entry in the array, checks to see if it’s a match, and returns immediately. So when ‘e’ is in the first position, you get True.

    SUMPRODUCT allows the checking to be applied across the entire array. Another way to see this would be to manually type it out into separate cells in a grid fashion like this

           A   |       B      |  C  |      D
    1 | Claude | =RIGHT(A1,1) | 'a' | =1*(B1=C1)
    2 |        | =RIGHT(A1,1) | 'e' | =1*(B2=C2)
    3 |        | =RIGHT(A1,1) | 'i' | =1*(B3=C3)
    4 |        | =RIGHT(A1,1) | 'n' | =1*(B4=C4)
    5 |        | =RIGHT(A1,1) | 'y' | =1*(B5=C5)
    6 |        |              |     | =SUM(D1:D5)
    

    The bottom right cell would contain a 1 if any of the characters a,e,i,n,y are at the end of the value in A1, or a 0 if not. I am manually performing the same logic as SUMPRODUCT to get to the same result.

    So, how this would be accomplished in C#.Net:

    var checkValue = "Claude";
    var letters = {"a", "e", "i", "n", "y"};
    var found = 0;
    
    foreach (var theLetter in letters)
        if (checkValue.EndsWith(theLetter))
            found = 1;
    
    return found; // returns same value as Excel function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.