Report data from one cell in a string of cells

LValencia

New Member
Joined
Dec 14, 2016
Messages
10
What I have is 5 cells in a row that may or may not have data. What I want is, if one or more cells have data I only want a particular cells data this would be the primary cell. This data would be collected in another cell in the sheet.
Example:
P1 20, Q1 0, R1 50, S1 10, T1 5. R1s data will always be used unless it is zero, then it would be P1s data. The formula would be in cell F1.
thanks for your help
tried several formulas but cant seem to get there.:(
 

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.

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
1,060
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Welcome to the board. In cell F1 try:

=if(R1=0,P1,R1)
 
Upvote 0

LValencia

New Member
Joined
Dec 14, 2016
Messages
10
ADVERTISEMENT
Worked great exactly what I needed. For my info what is counta and what is it asking excel to do?
 
Upvote 0

gaz_chops

Well-known Member
Joined
Apr 29, 2003
Messages
6,485
Platform
  1. MacOS
You're welcome, counta checks if any cells in the range have a value, if they do then returns P1 or R1, if no values then returns blank.
 
Upvote 0

LValencia

New Member
Joined
Dec 14, 2016
Messages
10
ADVERTISEMENT
Great thanks, one other question can I step it down, if P1 doesnt have value report S1, if no value then T1. Tried adding to formula but got error, no expert here learning from the board how to improve my formulas.
 
Upvote 0

gaz_chops

Well-known Member
Joined
Apr 29, 2003
Messages
6,485
Platform
  1. MacOS
Try

I haven't tested this

=IF(COUNTA(P1:T1),IF(R1<>0,R1,IF(P1<>0,P1,IF(Q1<>0,Q1,IF(S1<>0,S1,T1)))),"")
 
Upvote 0

LValencia

New Member
Joined
Dec 14, 2016
Messages
10
Worked great thank you for your time and expertise.
Merry Christmas and happy new year.
Go Saints (south hampton)
 
Upvote 0

Forum statistics

Threads
1,195,953
Messages
6,012,515
Members
441,703
Latest member
clivelincoln

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
Top