简体   繁体   中英

How to add 1 to every cell of a range in Google sheets / Excel

I'm trying to add value of 1 to every cell within a range. Formula that I am using at the moment is:

=IF(AND('Agent 1'!C3=A60;'Agent 1'!C4=A61);COUNT(pon8_9;))

pon8_9 is the name of the range. This returns a value of 1 but only in the cell where this formula is written. I want the value of 1 to be added to every cell in this pon8_9 range.

I'm having a really hard time finding functions or possibilities for this.

try:

=ARRAYFORMULA({
 IFNA(VLOOKUP(A60:A73, {{'Agent 1'!C3:C4;   'Agent 1'!C4 +"1:00:00"}, {1;1;""}}, 2, 1)),
 IFNA(VLOOKUP(A60:A73, {{'Agent 1'!C6:C7;   'Agent 1'!C7 +"1:00:00"}, {1;1;""}}, 2, 1)),
 IFNA(VLOOKUP(A60:A73, {{'Agent 1'!C9:C10;  'Agent 1'!C10+"1:00:00"}, {1;1;""}}, 2, 1)),
 IFNA(VLOOKUP(A60:A73, {{'Agent 1'!C12:C13; 'Agent 1'!C13+"1:00:00"}, {1;1;""}}, 2, 1)),
 IFNA(VLOOKUP(A60:A73, {{'Agent 1'!C15:C16; 'Agent 1'!C16+"1:00:00"}, {1;1;""}}, 2, 1)),
 IFNA(VLOOKUP(A60:A73, {{'Agent 1'!C18:C19; 'Agent 1'!C19+"1:00:00"}, {1;1;""}}, 2, 1)),
 IFNA(VLOOKUP(A60:A73, {{'Agent 1'!C21:C22; 'Agent 1'!C22+"1:00:00"}, {1;1;""}}, 2, 1))})

在此处输入图像描述

demo spreadsheet

=ARRAYFORMULA({
 IFNA(VLOOKUP(A60:A73; {{'Agent 1'!C3:C4;   'Agent 1'!C4 +"1:00:00"}\ {1;1;""}}; 2; 1))\
 IFNA(VLOOKUP(A60:A73; {{'Agent 1'!C6:C7;   'Agent 1'!C7 +"1:00:00"}\ {1;1;""}}; 2; 1))\
 IFNA(VLOOKUP(A60:A73; {{'Agent 1'!C9:C10;  'Agent 1'!C10+"1:00:00"}\ {1;1;""}}; 2; 1))\
 IFNA(VLOOKUP(A60:A73; {{'Agent 1'!C12:C13; 'Agent 1'!C13+"1:00:00"}\ {1;1;""}}; 2; 1))\
 IFNA(VLOOKUP(A60:A73; {{'Agent 1'!C15:C16; 'Agent 1'!C16+"1:00:00"}\ {1;1;""}}; 2; 1))\
 IFNA(VLOOKUP(A60:A73; {{'Agent 1'!C18:C19; 'Agent 1'!C19+"1:00:00"}\ {1;1;""}}; 2; 1))\
 IFNA(VLOOKUP(A60:A73; {{'Agent 1'!C21:C22; 'Agent 1'!C22+"1:00:00"}\ {1;1;""}}; 2; 1))})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM