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 8359949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:18:48+00:00 2026-06-09T11:18:48+00:00

Consider the following (partial) Excel sheet: | A | B C D -+—+—————— 1|id

  • 0

Consider the following (partial) Excel sheet:

 | A |   B     C     D
-+---+------------------
1|id | comp1 comp2 comp3
-+---+------------------
2| 1 |   1     0     0
3| 1 |   1     0     0
4| 2 |   0     1     0
5| 3 |   0     0     1
6| 1 |   1     0     0
7| 3 |   0     0     1

As an example, if filled in all zero’s and one’s in columns B, C and D by hand. I need to automate this because my dataset is to large to do it all manually. I need, for instance for cell B2, a formula which checks whether value of A2 is similar to company id in cell B1. If so, set a 1, else a 0. Another example: take row 4. It has company id 2 in cell A4 so B4 (comp1) should be 0, C4 1 and D4 0.

I have used the following formula in cell B2, ready to be dragged to all other cells:

=IF($A2=RIGHT(B$1;1);1;0)

However, it puts a 0 in B2. I don’t understand, because A2 has value 1, and so does RIGHT(B1;1), so IF(1=1;1;0), so B2 should get value 1. But it doesn’t where am I going wrong?

  • 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-06-09T11:18:49+00:00Added an answer on June 9, 2026 at 11:18 am

    Because right() returns a string and you compare a string to a number. You need to transform that string to a number, e.g. with value(right(…)).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following (partial) Excel worksheet: A | B | C | D ---+-------------+-------+-------
consider the following code, which represents an attempt to implement partial matching. the intended
Consider following make: all: a b a: echo a exit 1 b: echo b
Consider following SWT code example: http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet151.java?view=co How can I separate the inline defined class?
Consider following XML document fragment: <Book> <Title>Example</Title> <Content> Some line </Content> <TOC> Again some
Consider following example: class CBase abstract { protected: CBase() { } }; I could
Consider following example: #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <hiredis/hiredis.h> int main(int argc,
Consider following: Partial View: <%= Html.ListBox(BlackList, Model.Select( x => new SelectListItem { Text =
Consider the following code: public partial class TeacherControlPanel : System.Web.UI.Page { protected string username
The project holding the code has all default MSVS2008 settings. Consider the following code

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.