Auto populate B1 based on the values ranged from A1:A8

PAPPU

New Member
Joined
Jan 28, 2022
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Hi Gents

I will enter A,B,C,D,E,F,G,H from A1:A8

A,B,C,D belongs to X
E,F,G,H belongs to Y

Is it possible if I enter any of these A,B,C,D,E,F,G,H, for Eg: if I enter D in A3 , I wish to get X in B1 because A,B,C and D belongs to X ?
Similarly if any of these letter when i enter , I should get respective X or Y in cell B1

Thanks In Advance
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
From what I understand your just enter data in A3 and needing to get X or Y in B1 based on Cell A3 values. if thats the case try:

Book1
AB
1Y
2
3G
Sheet1
Cell Formulas
RangeFormula
B1B1=IF(OR(A3="A",A3="B",A3="C",A3="D"),"X",IF(OR(A3="E",A3="F",A3="G",A3="H"),"Y",""))


otherwise please clarify
 
Upvote 0
If you want a Vba solution then:
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

When you enter the proper value in Range("A1:A8") the script will run
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  2/3/2022  11:38:39 PM  EST
If Target.Column = 1 And Target.Row < 9 Then

Select Case Target.Value
    Case "A", "B", "C", "D"
        Range("B1").Value = "X"
    Case "E", "F", "G", "H"
        Range("B1").Value = "Y"
End Select

End If
End Sub
 
Upvote 0
Thanks all for the prompt reply,

I need a formula only, Let me please elaborate bit more

For eg: I have total of 32 person, say "1 to 32 as names" and they are divided into 4 groups

1-8 belongs to person A
9-16 belongs to person B
17-24 belongs to person C
25-32 belongs to person D

I have a table. from A1: A50 , I may enter any of these number from 1-32.

So,

If I enter 18 in cell A10 , I require C to be auto populated in cell E10
if I enter 28 in cell A10 , I require D to be auto populated in cell E10
And if i keep any of the cell from A1: A50 as empty then it should keep E1: E50 empty as well.
Book ABC.JPG


A short input is made and attached here.

Thanks
 
Upvote 0
OK: Thanks.
I'm good with Vba but not so much with formulas like you want.
This is beyond my knowledgebase.
I will continue to monitor this thread to see what I can learn.
 
Upvote 0
Are you actually putting names into col A or numbers?
 
Upvote 0
Thank you for the response, In fact In column A and E , it will be names for info
 
Upvote 0
One silly mistake. Please read as below, at earlier query Cell reference number was wrongly mentioned

If I enter 18 in cell B11 , I require C to be auto populated in cell E11
if I enter 28 in cell B11 , I require D to be auto populated in cell E11
And if i keep any of the cell from B1: B50 as empty then it should keep E1: E50 empty as well.
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,666
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top