Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
M.K M.K is offline
external usenet poster
 
Posts: 1
Default new cell in excel with data from other sheet

hi all

if i have coulm in excel include the followinf dat

334567778
224567890
334567890
123456765
678123678

and i want include new coulm with the following detales

if th first 4 digt is 3345 the cell will be from uae
but if the first 4 digt is 2245 the cell will be from USA
and if first 4 digt is 6781 the cell will from QAT
if the first 4 digt is 6781 the cekk will be from SA



334567778 from uae
224567890 from USA
334567890 from uae
123456765 from SA
678123678 from QAT



how i do that

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 225
Default new cell in excel with data from other sheet

You can use nested IF if you have only four countries...
Otherwise in another sheet (say Sheet2)
enter the numbers in Col A and corresponding country in Col B
then assuming your numbers are in Col A of Sheet1, enter this in Col B of
Sheet1
=VLOOKUP(LEFT(A1,4),Sheet2!A:B,2,FALSE)
and copy down...

"M.K" wrote:

hi all

if i have coulm in excel include the followinf dat

334567778
224567890
334567890
123456765
678123678

and i want include new coulm with the following detales

if th first 4 digt is 3345 the cell will be from uae
but if the first 4 digt is 2245 the cell will be from USA
and if first 4 digt is 6781 the cell will from QAT
if the first 4 digt is 6781 the cekk will be from SA



334567778 from uae
224567890 from USA
334567890 from uae
123456765 from SA
678123678 from QAT



how i do that

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default new cell in excel with data from other sheet

=IF(LEFT(A1,4)="3345","uae",IF(LEFT(A1,4)="2245"," usa",IF(LEFT(A1,4)="6781","qat","sa")))


Gord Dibben MS Excel MVP


On Mon, 16 Mar 2009 10:16:10 -0700, M.K
wrote:

hi all

if i have coulm in excel include the followinf dat

334567778
224567890
334567890
123456765
678123678

and i want include new coulm with the following detales

if th first 4 digt is 3345 the cell will be from uae
but if the first 4 digt is 2245 the cell will be from USA
and if first 4 digt is 6781 the cell will from QAT
if the first 4 digt is 6781 the cekk will be from SA



334567778 from uae
224567890 from USA
334567890 from uae
123456765 from SA
678123678 from QAT



how i do that


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default new cell in excel with data from other sheet

Hi,

Your 3rd and 4th numbers are the same, I'm assuming this is an error:
"if th first 4 digt is 3345 the cell will be from uae
but if the first 4 digt is 2245 the cell will be from USA
and if first 4 digt is 6781 the cell will from QAT
if the first 4 digt is 6781 the cekk will be from SA"


The most flexible way would be to use something like this which could be set
up to handle any number of prefixes:

1. Create a table like this in say G1:H4

3345 UAE
2245 USA
6781 QAT
1234 SA

Then your formula is

=VLOOKUP(--LEFT(A1,4),$G$1:$H$4,2,)

Where the data is in A1:A1000.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"M.K" wrote:

hi all

if i have coulm in excel include the followinf dat

334567778
224567890
334567890
123456765
678123678

and i want include new coulm with the following detales

if th first 4 digt is 3345 the cell will be from uae
but if the first 4 digt is 2245 the cell will be from USA
and if first 4 digt is 6781 the cell will from QAT
if the first 4 digt is 6781 the cekk will be from SA



334567778 from uae
224567890 from USA
334567890 from uae
123456765 from SA
678123678 from QAT



how i do that

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default new cell in excel with data from other sheet

You could either setup a table (Say in D2:E5) with your correlations
3345 uae
2245 USA
6781 QAT
1234 SA


Then your formula could be:
=VLOOKUP(VALUE(LEFT(A2,4)),$D$2:$E$5,2,FALSE)
and copy down as needed.

The benefit of this setup si that you could easily add additional entries to
your table as needed.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"M.K" wrote:

hi all

if i have coulm in excel include the followinf dat

334567778
224567890
334567890
123456765
678123678

and i want include new coulm with the following detales

if th first 4 digt is 3345 the cell will be from uae
but if the first 4 digt is 2245 the cell will be from USA
and if first 4 digt is 6781 the cell will from QAT
if the first 4 digt is 6781 the cekk will be from SA



334567778 from uae
224567890 from USA
334567890 from uae
123456765 from SA
678123678 from QAT



how i do that



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy data of two cells from Sheet 2 into one cell in Sheet 1 cahabbinga Excel Worksheet Functions 6 January 30th 08 01:00 PM
How do i transfer cell data from one sheet to the other in Excel Robin New Users to Excel 4 April 6th 07 08:02 AM
how to copy a cell with formula from sheet 1 (data is all vertical) into sheet 2 parag Excel Worksheet Functions 3 June 15th 06 10:29 PM
referencing a sheet named in a cell then using data from that sheet gbeard Excel Worksheet Functions 4 April 15th 05 08:42 AM
Automatic cell increment with data from sheet 1 to sheet 2 Big G Excel Worksheet Functions 2 December 20th 04 05:59 PM


All times are GMT +1. The time now is 09:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"