Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default If variable, then variable

I want to have a cell retrieve contents from another cell using the IF
function, but I need it to be variable. For instance, I want a cell to
receive contents from cell B2, if contents of another cell are A2, and if the
contents of that same cell are A3, then I want the B3 to show up, A4 - B4,
etc.

Is there a way to use a number placeholder like =IF($B$3=A$'x',B'x') where
'x' represents the number that I want to vary?

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default If variable, then variable

Sounds like a VLOOKUP.
--
David Biddulph

"$andsense" wrote in message
...
I want to have a cell retrieve contents from another cell using the IF
function, but I need it to be variable. For instance, I want a cell to
receive contents from cell B2, if contents of another cell are A2, and if
the
contents of that same cell are A3, then I want the B3 to show up, A4 - B4,
etc.

Is there a way to use a number placeholder like =IF($B$3=A$'x',B'x') where
'x' represents the number that I want to vary?

Thanks,



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default If variable, then variable

Hmmm, I think you might be right - if I can just figure out how to use it?

"David Biddulph" wrote:

Sounds like a VLOOKUP.
--
David Biddulph

"$andsense" wrote in message
...
I want to have a cell retrieve contents from another cell using the IF
function, but I need it to be variable. For instance, I want a cell to
receive contents from cell B2, if contents of another cell are A2, and if
the
contents of that same cell are A3, then I want the B3 to show up, A4 - B4,
etc.

Is there a way to use a number placeholder like =IF($B$3=A$'x',B'x') where
'x' represents the number that I want to vary?

Thanks,




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default If variable, then variable

Once I figured this out it worked well. Thanks for the help Biddulph

"David Biddulph" wrote:

Sounds like a VLOOKUP.
--
David Biddulph

"$andsense" wrote in message
...
I want to have a cell retrieve contents from another cell using the IF
function, but I need it to be variable. For instance, I want a cell to
receive contents from cell B2, if contents of another cell are A2, and if
the
contents of that same cell are A3, then I want the B3 to show up, A4 - B4,
etc.

Is there a way to use a number placeholder like =IF($B$3=A$'x',B'x') where
'x' represents the number that I want to vary?

Thanks,




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 149
Default If variable, then variable

If A1 = 8, then
=INDIRECT("B"&A1)
would return the value of cell B8.


However, given the *exact* scenario you describe.("return the value in colB
where colA = x"), you could use Vlookup.

- D1 holds your LookupValue
- A2:B10 holds your table of values
- some other cell: = VLOOKUP(C1, A2:B10, 2, FALSE)
This would return the value from column B of your table where column A
exactly matches LookupValue. Column A does not need to be sorted.

--
HTH,
George


"$andsense" wrote in message
...
I want to have a cell retrieve contents from another cell using the IF
function, but I need it to be variable. For instance, I want a cell to
receive contents from cell B2, if contents of another cell are A2, and if
the
contents of that same cell are A3, then I want the B3 to show up, A4 - B4,
etc.

Is there a way to use a number placeholder like =IF($B$3=A$'x',B'x') where
'x' represents the number that I want to vary?

Thanks,





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 149
Default If variable, then variable

some other cell: = VLOOKUP(C1, A2:B10, 2, FALSE)
typo: should be D1, not C1

--
HTH,
George


"George Nicholson" wrote in message
...
If A1 = 8, then
=INDIRECT("B"&A1)
would return the value of cell B8.


However, given the *exact* scenario you describe.("return the value in
colB where colA = x"), you could use Vlookup.

- D1 holds your LookupValue
- A2:B10 holds your table of values
- some other cell: = VLOOKUP(C1, A2:B10, 2, FALSE)
This would return the value from column B of your table where column A
exactly matches LookupValue. Column A does not need to be sorted.

--
HTH,
George


"$andsense" wrote in message
...
I want to have a cell retrieve contents from another cell using the IF
function, but I need it to be variable. For instance, I want a cell to
receive contents from cell B2, if contents of another cell are A2, and if
the
contents of that same cell are A3, then I want the B3 to show up, A4 -
B4,
etc.

Is there a way to use a number placeholder like =IF($B$3=A$'x',B'x')
where
'x' represents the number that I want to vary?

Thanks,





  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default If variable, then variable

Got it - this worked well. Thanks for the help!

"George Nicholson" wrote:

some other cell: = VLOOKUP(C1, A2:B10, 2, FALSE)

typo: should be D1, not C1

--
HTH,
George


"George Nicholson" wrote in message
...
If A1 = 8, then
=INDIRECT("B"&A1)
would return the value of cell B8.


However, given the *exact* scenario you describe.("return the value in
colB where colA = x"), you could use Vlookup.

- D1 holds your LookupValue
- A2:B10 holds your table of values
- some other cell: = VLOOKUP(C1, A2:B10, 2, FALSE)
This would return the value from column B of your table where column A
exactly matches LookupValue. Column A does not need to be sorted.

--
HTH,
George


"$andsense" wrote in message
...
I want to have a cell retrieve contents from another cell using the IF
function, but I need it to be variable. For instance, I want a cell to
receive contents from cell B2, if contents of another cell are A2, and if
the
contents of that same cell are A3, then I want the B3 to show up, A4 -
B4,
etc.

Is there a way to use a number placeholder like =IF($B$3=A$'x',B'x')
where
'x' represents the number that I want to vary?

Thanks,






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
variable height variable width stacked bar charts ambthiru Charts and Charting in Excel 3 January 18th 06 11:41 PM
variable in a link where the variable is the name of the sheet darrelly Excel Worksheet Functions 1 October 7th 05 08:24 AM
Sum cells based on a row variable and seperate column variable CheeseHeadTransplant Excel Worksheet Functions 10 September 23rd 05 06:59 PM
object variable or with block variable not set Diego Excel Discussion (Misc queries) 1 August 9th 05 02:46 PM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM


All times are GMT +1. The time now is 02:15 AM.

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"