#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Newbie help

Newbie here. This is what my file looks like:

A1 THIS
A2 ****
A3 ****
A4 ****
A5 ****
A6 THAT
A7 ****
A8 ****
A9 ****
A10 ****
A11 THIS
A12 ****
etc...

What I want to do is write a formula that will determine
the value of the cells in column "b" depending if THIS or THAT
was last read. For example cells A1 - A5 would be value of 1.
A6 - A10 would be 2. A11 - A12 would be 1 again.


I think what I need to do would be create a variable and print that variable
value in column B. The variable would switch values when it read
THIS or THAT. I can write an if statement to create the variable value.
Not sure how to handle the rest. Would I have to use a For Next loop and
step through until I reached the end of my file?


T.I.A.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Newbie help

Hi
in B1 enter
=IF(A1="THIS",1,IF(A1="THAT",2,""))
and copy this formula down for all rows

--
Regards
Frank Kabel
Frankfurt, Germany


Ed wrote:
Newbie here. This is what my file looks like:

A1 THIS
A2 ****
A3 ****
A4 ****
A5 ****
A6 THAT
A7 ****
A8 ****
A9 ****
A10 ****
A11 THIS
A12 ****
etc...

What I want to do is write a formula that will determine
the value of the cells in column "b" depending if THIS or THAT
was last read. For example cells A1 - A5 would be value of 1.
A6 - A10 would be 2. A11 - A12 would be 1 again.


I think what I need to do would be create a variable and print that
variable value in column B. The variable would switch values when it
read
THIS or THAT. I can write an if statement to create the variable
value.
Not sure how to handle the rest. Would I have to use a For Next loop
and step through until I reached the end of my file?


T.I.A.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Newbie help

Frank,

That formula will not make cell A2 the value of 1.




"Frank Kabel" wrote in message
...
Hi
in B1 enter
=IF(A1="THIS",1,IF(A1="THAT",2,""))
and copy this formula down for all rows

--
Regards
Frank Kabel
Frankfurt, Germany


Ed wrote:
Newbie here. This is what my file looks like:

A1 THIS
A2 ****
A3 ****
A4 ****
A5 ****
A6 THAT
A7 ****
A8 ****
A9 ****
A10 ****
A11 THIS
A12 ****
etc...

What I want to do is write a formula that will determine
the value of the cells in column "b" depending if THIS or THAT
was last read. For example cells A1 - A5 would be value of 1.
A6 - A10 would be 2. A11 - A12 would be 1 again.


I think what I need to do would be create a variable and print that
variable value in column B. The variable would switch values when it
read
THIS or THAT. I can write an if statement to create the variable
value.
Not sure how to handle the rest. Would I have to use a For Next loop
and step through until I reached the end of my file?


T.I.A.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Newbie help

Hi
I thought you want the values in column B?. Could you provide also an
example of your expected result

--
Regards
Frank Kabel
Frankfurt, Germany


Ed wrote:
Frank,

That formula will not make cell A2 the value of 1.




"Frank Kabel" wrote in message
...
Hi
in B1 enter
=IF(A1="THIS",1,IF(A1="THAT",2,""))
and copy this formula down for all rows

--
Regards
Frank Kabel
Frankfurt, Germany


Ed wrote:
Newbie here. This is what my file looks like:

A1 THIS
A2 ****
A3 ****
A4 ****
A5 ****
A6 THAT
A7 ****
A8 ****
A9 ****
A10 ****
A11 THIS
A12 ****
etc...

What I want to do is write a formula that will determine
the value of the cells in column "b" depending if THIS or THAT
was last read. For example cells A1 - A5 would be value of 1.
A6 - A10 would be 2. A11 - A12 would be 1 again.


I think what I need to do would be create a variable and print that
variable value in column B. The variable would switch values when

it
read
THIS or THAT. I can write an if statement to create the variable
value.
Not sure how to handle the rest. Would I have to use a For Next

loop
and step through until I reached the end of my file?


T.I.A.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Newbie help

If your only possible data is one of two things (THIS or
THAT), try this formula and copy it down. Add a blank
row at the top so the first formula has a cell to read
(B1).

=IF(A2="THIS",1,IF(A2="THAT",2,B1))
Linda

-----Original Message-----
Newbie here. This is what my file looks like:

A1 THIS
A2 ****
A3 ****
A4 ****
A5 ****
A6 THAT
A7 ****
A8 ****
A9 ****
A10 ****
A11 THIS
A12 ****
etc...

What I want to do is write a formula that will determine
the value of the cells in column "b" depending if THIS

or THAT
was last read. For example cells A1 - A5 would be value

of 1.
A6 - A10 would be 2. A11 - A12 would be 1 again.


I think what I need to do would be create a variable and

print that variable
value in column B. The variable would switch values when

it read
THIS or THAT. I can write an if statement to create the

variable value.
Not sure how to handle the rest. Would I have to use a

For Next loop and
step through until I reached the end of my file?


T.I.A.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Newbie help

Frank,
You're right, i'm sorry. What I meant to write was "That formula will not
make cell B2 the value of 1".

What I want to do is write a formula that will determine
the value of the cells in column "b" depending if THIS or THAT
was last read. For example cells A1 - A5 would be value of 1.
A6 - A10 would be 2. A11 - A12 would be 1 again.


This should have read B1-B5 would be value of 1.
B6-B10 would be 2.
B11-B12 would be 1 again
and so on.

A1 THIS
A2 other text
A3 other text
A4 other text
A5 other text
A6 THAT
A7 other text
A8 other text
A9 other text
A10 other text
A11 THIS
A12 other text
etc...


Sorry for the confusion.






"Frank Kabel" wrote in message
...
Hi
I thought you want the values in column B?. Could you provide also an
example of your expected result

--
Regards
Frank Kabel
Frankfurt, Germany


Ed wrote:
Frank,

That formula will not make cell A2 the value of 1.




"Frank Kabel" wrote in message
...
Hi
in B1 enter
=IF(A1="THIS",1,IF(A1="THAT",2,""))
and copy this formula down for all rows

--
Regards
Frank Kabel
Frankfurt, Germany


Ed wrote:
Newbie here. This is what my file looks like:

A1 THIS
A2 ****
A3 ****
A4 ****
A5 ****
A6 THAT
A7 ****
A8 ****
A9 ****
A10 ****
A11 THIS
A12 ****
etc...

What I want to do is write a formula that will determine
the value of the cells in column "b" depending if THIS or THAT
was last read. For example cells A1 - A5 would be value of 1.
A6 - A10 would be 2. A11 - A12 would be 1 again.


I think what I need to do would be create a variable and print that
variable value in column B. The variable would switch values when

it
read
THIS or THAT. I can write an if statement to create the variable
value.
Not sure how to handle the rest. Would I have to use a For Next

loop
and step through until I reached the end of my file?


T.I.A.




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Newbie help

Hi
try the following in B1
=IF(A1="THIS",1,IF(A1="THAT",2,""))

in B2 enter
=IF(A1="THIS",1,IF(A1="THAT",2,B1))
and copy this formula down


--
Regards
Frank Kabel
Frankfurt, Germany


Ed wrote:
Frank,
You're right, i'm sorry. What I meant to write was "That formula will
not make cell B2 the value of 1".

What I want to do is write a formula that will determine
the value of the cells in column "b" depending if THIS or THAT
was last read. For example cells A1 - A5 would be value of 1.
A6 - A10 would be 2. A11 - A12 would be 1 again.


This should have read B1-B5 would be value of 1.
B6-B10 would be 2.
B11-B12 would be 1 again
and so on.

A1 THIS
A2 other text
A3 other text
A4 other text
A5 other text
A6 THAT
A7 other text
A8 other text
A9 other text
A10 other text
A11 THIS
A12 other text
etc...


Sorry for the confusion.






"Frank Kabel" wrote in message
...
Hi
I thought you want the values in column B?. Could you provide also

an
example of your expected result

--
Regards
Frank Kabel
Frankfurt, Germany


Ed wrote:
Frank,

That formula will not make cell A2 the value of 1.




"Frank Kabel" wrote in message
...
Hi
in B1 enter
=IF(A1="THIS",1,IF(A1="THAT",2,""))
and copy this formula down for all rows

--
Regards
Frank Kabel
Frankfurt, Germany


Ed wrote:
Newbie here. This is what my file looks like:

A1 THIS
A2 ****
A3 ****
A4 ****
A5 ****
A6 THAT
A7 ****
A8 ****
A9 ****
A10 ****
A11 THIS
A12 ****
etc...

What I want to do is write a formula that will determine
the value of the cells in column "b" depending if THIS or THAT
was last read. For example cells A1 - A5 would be value of 1.
A6 - A10 would be 2. A11 - A12 would be 1 again.


I think what I need to do would be create a variable and print
that variable value in column B. The variable would switch values
when it read
THIS or THAT. I can write an if statement to create the variable
value.
Not sure how to handle the rest. Would I have to use a For Next
loop and step through until I reached the end of my file?


T.I.A.


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
newbie lena Excel Worksheet Functions 5 February 6th 09 03:36 PM
Please help Newbie Bblatz Excel Worksheet Functions 1 April 23rd 08 09:21 AM
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Newbie Help. Is this possible? taltos1 Excel Discussion (Misc queries) 5 November 12th 05 04:40 PM
Newbie Needs some help Bill McN Excel Programming 2 January 15th 04 12:16 AM


All times are GMT +1. The time now is 12:19 AM.

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

About Us

"It's about Microsoft Excel"